Skip to content

ignatandrei/RSCG_IFormattable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSCG_IFormattable

Roslyn Code Generator for IFormattable

Usage

Add to your csproj file:

<ItemGroup>
  <PackageReference Include="RSCG_IFormattable" Version="2024.713.1446" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
  <PackageReference Include="RSCG_IFormattableCommon" Version="2024.713.1446" />
</ItemGroup>

Add to your source file:

[RSCG_IFormattableCommon.AddIFormattable]
internal partial class Person
{
    public string? FirstName { get; set; }
    public string? LastName { get; set; }
}

And then the result is

using RSCG_IFormattableConsole;

Person person = new ();
person.FirstName = "Andrei";
person.LastName = "Ignat";

Console.WriteLine(person.ToString("The person name is {FirstName} {LastName}",null));

About

Roslyn Code Generator for IFormattable

Resources

License

Stars

Watchers

Forks

Packages

No packages published