AutoInterface 2.4.0
dotnet add package AutoInterface --version 2.4.0
NuGet\Install-Package AutoInterface -Version 2.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AutoInterface" Version="2.4.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AutoInterface --version 2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AutoInterface, 2.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AutoInterface as a Cake Addin #addin nuget:?package=AutoInterface&version=2.4.0 // Install AutoInterface as a Cake Tool #tool nuget:?package=AutoInterface&version=2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AutoInterface
AutoInterface is a source generator that generates an interface based on your class/struct.
Basically, you write your class and get the corresponding interface for free.
using AutoInterfaceAttributes;
[AutoInterface]
public class Example : IExample {
public int Number { get; private set; }
public Example() {
ResetNumber();
}
/// <summary>
/// some method description
/// </summary>
public int AddToNumber(int increase) {
Number += increase;
return Number;
}
private void ResetNumber() => Number = 0;
}
// <auto-generated/>
#pragma warning disable
#nullable enable annotations
using AutoInterfaceAttributes;
public interface IExample {
int Number { get; }
/// <summary>
/// some method description
/// </summary>
int AddToNumber(int increase);
}
AutoInterface supports:
- classes, records and structs
- all members (Method, Property, Indexer, Event)
- also explicit Interface members
- multiple attributes on same class
- summary of class/struct and members
- generic
- parameters for
- interface name
- interface modifier
- interface namespace
- interface inheritance
- interface nesting
- static members as static abstract
- access modifier
- ignore specific members
For documentation or sourcecode see github.com/BlackWhiteYoshi/AutoInterface.
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
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 |
---|---|---|
2.4.0 | 2,015 | 8/19/2024 |
2.3.0 | 3,552 | 4/14/2024 |
2.2.1 | 198 | 4/11/2024 |
2.2.0 | 405 | 4/6/2024 |
2.1.0 | 1,062 | 3/2/2024 |
2.0.2 | 172 | 3/2/2024 |
2.0.1 | 238 | 3/1/2024 |
2.0.0 | 207 | 3/1/2024 |
1.3.0 | 489 | 2/4/2024 |
1.2.6 | 605 | 1/6/2024 |
1.2.5 | 198 | 1/6/2024 |
1.2.4 | 302 | 11/16/2023 |
1.2.3 | 241 | 9/19/2023 |
1.2.2 | 202 | 7/7/2023 |
1.2.1 | 197 | 7/2/2023 |
1.2.0 | 200 | 7/1/2023 |
1.1.0 | 220 | 6/30/2023 |
1.0.1 | 191 | 6/30/2023 |
1.0.0 | 200 | 6/30/2023 |