Hsu.Sg.FluentMember
2023.412.21
See the version list below for details.
dotnet add package Hsu.Sg.FluentMember --version 2023.412.21
NuGet\Install-Package Hsu.Sg.FluentMember -Version 2023.412.21
<PackageReference Include="Hsu.Sg.FluentMember" Version="2023.412.21"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Hsu.Sg.FluentMember --version 2023.412.21
#r "nuget: Hsu.Sg.FluentMember, 2023.412.21"
// Install Hsu.Sg.FluentMember as a Cake Addin #addin nuget:?package=Hsu.Sg.FluentMember&version=2023.412.21 // Install Hsu.Sg.FluentMember as a Cake Tool #tool nuget:?package=Hsu.Sg.FluentMember&version=2023.412.21
Hsu.Sg.FluentMember
Generate a fluent method for fields and properties from a struct
or class
.
Package Version
Name | Source | Stable | Preview |
---|---|---|---|
Hsu.Sg.FluentMember | Nuget | ||
Hsu.Sg.FluentMember | MyGet |
Usages
Install
- Hsu.Sg.FluentMember
You can install the package from nuget.
<PackageReference Include="Hsu.Sg.FluentMember" Version="2023.412.12">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Attributes
Add the FluentMember
attribute and partial
keyword to the class
or struct
.
[FluentMember]
public partial class ClassSamplePartial
{
}
If you want to specify fluent members to generate, you just need to set [FluentMember(Only = true)]
and add [FluentMemberGen]
attribute to the members.
[FluentMember(Only = true)]
public partial class ClassSampleSyncOnly
{
[FluentMemberGen(Ignore = true)]
public DayOfWeek Week { get; set; }
[FluentMemberGen(Ignore = true)]
private DayOfWeek PrivateWeek;
[FluentMemberGen(Ignore = true)]
public event Action EventAction;
}
If you want to ignore generate fluent members, you just need to add [FluentMemberGen(Ignore=true)]
attribute to the members.
[FluentMember]
public partial class ClassSampleSyncOnly
{
[FluentMemberGen(Ignore = true)]
public event Action EventAction;
}
If you want to specify an identifier with generated a proxy member, you just need to add [FluentMemberGen(Identifier = "UseOnEnterWithArgs")]
attribute to that member.
[FluentMember(Private = true)]
public partial class TestEventClass
{
[FluentMemberGen(Identifier = "UseOnEnterWithArgs")]
public event EventHandler<EventArgs> OnEnterWithArgs;
}
If you want to specify an prefix with generated a fluent object, you just need to add [FluentMember(Prefix = "With")]
attribute to that object or add [FluentMemberGen(Prefix = "Add")]
attribute to that member.
[FluentMember(Internal = true,Private = true,Prefix = "With")]
public partial class TestFieldClass
{
[FluentMemberGen(Prefix = "Add",Modifier = Accessibility.Internal)]
protected event Action<object> onResult;
}
If you want to specify an accessible with generated a fluent object, you just need to add [FluentMemberGen(Modifier = Accessibility.Internal)]
attribute to that member.
[FluentMember]
public partial class TestFieldClass
{
[FluentMemberGen(Modifier = Accessibility.Internal)]
private event Action<object> onResult;
}
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 |
---|---|---|
2024.101.8-rc175707 | 177 | 1/8/2024 |
2023.412.21 | 246 | 12/21/2023 |
2023.412.21-rc202346 | 123 | 12/21/2023 |
2023.412.17 | 176 | 12/17/2023 |
2023.412.17-rc170547 | 161 | 12/17/2023 |
2023.412.13 | 214 | 12/13/2023 |
2023.412.12.1 | 142 | 12/12/2023 |
2023.412.12 | 141 | 12/12/2023 |