Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
beakona committed Dec 1, 2023
1 parent 15254d2 commit 7a16f8d
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# AutoAs
# AutoAs

C# [Source Generator](https://github.com/dotnet/roslyn/blob/master/docs/features/source-generators.md) which generates fluent AsInterface cast-methods for all interfaces type implements.
<br>

Manually written source:

```csharp

public interface IPrintable
{
}

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

Auto-generated accompanying source:

```csharp
partial class Person
{
public IPrintable AsPrintable() => this;
}
```
<br>

Other examples can be found in [wiki](https://github.com/beakona/AutoAs/wiki/Examples).

<br>
---

![.NET Core](https://github.com/beakona/AutoAs/workflows/.NET%20Core/badge.svg)
[![NuGet](https://img.shields.io/nuget/v/BeaKona.AutoAsGenerator)](https://www.nuget.org/packages/BeaKona.AutoAsGenerator)

0 comments on commit 7a16f8d

Please sign in to comment.