Skip to content

beakona/AutoAs

Repository files navigation

AutoAs

C# Source Generator which generates fluent AsInterface cast-methods for all interfaces type implements.

Manually written source:

public interface IPrintable
{
}

[BeaKona.GenerateAutoAs]
public partial class Person : IPrintable
{
}

Auto-generated accompanying source:

partial class Person
{
   public IPrintable AsPrintable() => this;
}

Other examples can be found in wiki.


---

.NET Core NuGet

About

Fluent AsInterface() method C# source generator.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages