MakeInterface.Generator 1.0.0-preview2

This is a prerelease version of MakeInterface.Generator.
There is a newer version of this package available.
See the version list below for details.
dotnet add package MakeInterface.Generator --version 1.0.0-preview2
                    
NuGet\Install-Package MakeInterface.Generator -Version 1.0.0-preview2
                    
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="MakeInterface.Generator" Version="1.0.0-preview2">
  <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.
<PackageVersion Include="MakeInterface.Generator" Version="1.0.0-preview2" />
                    
Directory.Packages.props
<PackageReference Include="MakeInterface.Generator">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MakeInterface.Generator --version 1.0.0-preview2
                    
#r "nuget: MakeInterface.Generator, 1.0.0-preview2"
                    
#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.
#:package MakeInterface.Generator@1.0.0-preview2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MakeInterface.Generator&version=1.0.0-preview2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MakeInterface.Generator&version=1.0.0-preview2&prerelease
                    
Install as a Cake Tool

MakeInterface

Creates an interface of a class using source generator

.NET

Usage

Add the attribute to the class you want to generate the interface for

[GenerateInterface]
public class MyClass
{
	public string MyProperty { get; set; }
	public void MyMethod() { }
}

The generated interface will then be generated as IMyClass.g.cs

public interface IMyClass
{
	string MyProperty { get; set; }
	void MyMethod();
}

You can then implement the interface in your class

public class MyClass : IMyClass
{
	public string MyProperty { get; set; }
	public void MyMethod() { }
}

Installation

Install the NuGet package MakeInterface

The required GenerateInterface attribute is automatically provided by the source generator, so no additional package reference is needed.

License

MIT

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
1.0.4 283 6/10/2025
1.0.1 107 6/7/2025
1.0.0 112 6/7/2025
1.0.0-preview2 108 6/6/2025
1.0.0-preview1 107 6/6/2025
0.4.1 515 1/25/2024
0.4.0 233 1/17/2024
0.3.3 508 12/23/2022
0.3.2 330 12/22/2022
0.3.1 369 12/22/2022
0.3.0 337 12/21/2022
0.2.3 335 12/21/2022
0.2.2 338 12/21/2022
0.2.1 323 12/21/2022
0.2.0 335 12/19/2022
0.1.2 347 12/19/2022
0.1.1 358 12/19/2022
0.1.0 338 12/18/2022
0.0.3 381 12/16/2022
0.0.2 348 12/16/2022
0.0.1 340 12/16/2022