Hsu.Sg.Proxy
2026.101.6
dotnet add package Hsu.Sg.Proxy --version 2026.101.6
NuGet\Install-Package Hsu.Sg.Proxy -Version 2026.101.6
<PackageReference Include="Hsu.Sg.Proxy" Version="2026.101.6"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Hsu.Sg.Proxy" Version="2026.101.6" />
<PackageReference Include="Hsu.Sg.Proxy"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Hsu.Sg.Proxy --version 2026.101.6
#r "nuget: Hsu.Sg.Proxy, 2026.101.6"
#:package Hsu.Sg.Proxy@2026.101.6
#addin nuget:?package=Hsu.Sg.Proxy&version=2026.101.6
#tool nuget:?package=Hsu.Sg.Proxy&version=2026.101.6
Hsu.Sg.Proxy
Generate a proxy object from a struct or class or interface.
Package Version
| Name | Source | Stable | Preview |
|---|---|---|---|
| Hsu.Sg.Proxy | Nuget | ||
| Hsu.Sg.Proxy | MyGet |
Usages
Install
- Hsu.Sg.Proxy
You can install the package from nuget.
<PackageReference Include="Hsu.Sg.Proxy" Version="2023.412.12">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Attributes
Add the Proxy attribute and partial keyword to the class or struct or interface.
[Proxy]
public partial class ClassSamplePartial
{
}
If you want to specify proxy members to generate, you just need to set [Proxy(Only = true)] and add [ProxyGen] attribute to the members.
[Proxy(Only = true,Static = true,Abstract = true,Suffix = "Builder")]
public partial class ClassSampleSyncOnly
{
[ProxyGen(Ignore = false)]
public DayOfWeek Week { get; set; }
[ProxyGen(Ignore = false)] private DayOfWeek PrivateWeek;
[ProxyGen(Ignore = false)] public event Action EventAction;
[ProxyGen(Ignore = false)] public event EventHandler Event;
[ProxyGen(Ignore = false)]
public static Task StaticTaskAsync()
{
return Task.CompletedTask;
}
}
If you want to ignore generate proxy members, you just need to add [ProxyGen(Ignore=true)] attribute to the members.
[Proxy]
public partial class ClassSampleSyncOnly
{
[ProxyGen(Ignore = true)]
public event Action EventAction;
[ProxyGen(Ignore = true)]
public static Task StaticTaskIgnoreAsync()
{
return Task.CompletedTask;
}
}
If you want to specify an identifier with generated a proxy object, you just need to add [Proxy(Identifier = "InterfaceIdentity")] attribute to that object.
[Proxy(Sealed = true, Identifier = "InterfaceIdentity")]
public partial interface InterfaceSample
{
Task AwaitAsync(int index, string name, Cts token);
}
If you want to specify an suffix with generated a proxy object, you just need to add [Proxy(Suffix = "Builder")] attribute to that object.
[Proxy(Only = true,Static = true,Abstract = true,Suffix = "Builder")]
public partial class ClassSampleSyncOnly
{
}
If you want to specify interface with generated a proxy object, you just need to add [Proxy(Interfaces = new []{nameof(IAsync)})] attribute to that object.
public interface IAsync {}
[Proxy(Interfaces = new []{nameof(IAsync)})]
public partial class ClassSamplePartial
{
}
References
License
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Nito.AsyncEx.Context (>= 5.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.101.6 | 93 | 1/6/2026 |
| 2026.101.5 | 89 | 1/5/2026 |
| 2026.101.5-rc173948 | 91 | 1/5/2026 |
| 2026.101.5-rc145021 | 88 | 1/5/2026 |
| 2024.101.8-rc175707 | 266 | 1/8/2024 |
| 2023.412.21 | 349 | 12/21/2023 |
| 2023.412.21-rc202346 | 203 | 12/21/2023 |
| 2023.412.17 | 257 | 12/17/2023 |
| 2023.412.17-rc170547 | 230 | 12/17/2023 |
| 2023.412.12 | 246 | 12/12/2023 |
| 2023.410.20.1 | 303 | 10/20/2023 |
| 2023.410.20 | 304 | 10/20/2023 |
| 2023.410.19-pre1 | 297 | 10/18/2023 |
| 2023.410.18 | 333 | 10/18/2023 |