AutoInterface 2.3.0

dotnet add package AutoInterface --version 2.3.0
NuGet\Install-Package AutoInterface -Version 2.3.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.3.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.3.0
#r "nuget: AutoInterface, 2.3.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.3.0

// Install AutoInterface as a Cake Tool
#tool nuget:?package=AutoInterface&version=2.3.0

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
    • 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.3.0 295 4/14/2024
2.2.1 138 4/11/2024
2.2.0 329 4/6/2024
2.1.0 878 3/2/2024
2.0.2 117 3/2/2024
2.0.1 178 3/1/2024
2.0.0 144 3/1/2024
1.3.0 419 2/4/2024
1.2.6 525 1/6/2024
1.2.5 149 1/6/2024
1.2.4 266 11/16/2023
1.2.3 193 9/19/2023
1.2.2 170 7/7/2023
1.2.1 167 7/2/2023
1.2.0 167 7/1/2023
1.1.0 188 6/30/2023
1.0.1 161 6/30/2023
1.0.0 133 6/30/2023