AutoInterface 1.2.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package AutoInterface --version 1.2.3                
NuGet\Install-Package AutoInterface -Version 1.2.3                
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="1.2.3">
  <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 1.2.3                
#r "nuget: AutoInterface, 1.2.3"                
#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=1.2.3

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

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 and structs
  • all members (Method, Property, Indexer, Event)
  • also explicit Interface members
  • summary of class/struct and members
  • generic
  • parameters for
    • interface name
    • interface modifier
    • interface namespace
    • interface inheritance
    • 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.4.0 1,081 8/19/2024
2.3.0 3,343 4/14/2024
2.2.1 189 4/11/2024
2.2.0 398 4/6/2024
2.1.0 1,053 3/2/2024
2.0.2 167 3/2/2024
2.0.1 234 3/1/2024
2.0.0 198 3/1/2024
1.3.0 483 2/4/2024
1.2.6 596 1/6/2024
1.2.5 193 1/6/2024
1.2.4 297 11/16/2023
1.2.3 236 9/19/2023
1.2.2 197 7/7/2023
1.2.1 192 7/2/2023
1.2.0 195 7/1/2023
1.1.0 215 6/30/2023
1.0.1 186 6/30/2023
1.0.0 194 6/30/2023