-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
beakona edited this page Dec 1, 2023
·
3 revisions
Manually written source:
public interface IPrintable
{
}
[BeaKona.GenerateAutoAs]
public partial class Person : IPrintable
{
}
Auto-generated accompanying source:
partial class Person
{
public IPrintable AsPrintable() => this;
}
Manually written source:
internal interface IPrintable
{
}
[BeaKona.GenerateAutoAs]
public partial class Person : IPrintable
{
}
Auto-generated accompanying source:
partial class Person
{
internal IPrintable AsPrintable() => this;
}
Manually written source:
public interface IBase
{
}
public interface IPrintable : IBase
{
}
[BeaKona.GenerateAutoAs(EntireInterfaceHierarchy = true)]
public partial class Person : IPrintable
{
}
Auto-generated accompanying source:
partial class Person
{
public IPrintable AsPrintable() => this;
public IBase AsBase() => this;
}
Manually written source:
public interface IPrintable
{
}
[BeaKona.GenerateAutoAs(SkipSystemInterfaces = true)]
public partial class Person : IPrintable, IEnumerable
{
}
Auto-generated accompanying source:
partial class Person
{
public IPrintable AsPrintable() => this;
}