MakeInterface.Generator
0.4.1
dotnet add package MakeInterface.Generator --version 0.4.1
NuGet\Install-Package MakeInterface.Generator -Version 0.4.1
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="0.4.1"> <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 MakeInterface.Generator --version 0.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MakeInterface.Generator, 0.4.1"
#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 MakeInterface.Generator as a Cake Addin #addin nuget:?package=MakeInterface.Generator&version=0.4.1 // Install MakeInterface.Generator as a Cake Tool #tool nuget:?package=MakeInterface.Generator&version=0.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MakeInterface
Creates an interface of a class using source generator
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
You can either create the attribute yourself or use the one provided in the package MakeInterface.Contracts
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 |
---|---|---|
0.4.1 | 270 | 1/25/2024 |
0.4.0 | 202 | 1/17/2024 |
0.3.3 | 452 | 12/23/2022 |
0.3.2 | 294 | 12/22/2022 |
0.3.1 | 324 | 12/22/2022 |
0.3.0 | 302 | 12/21/2022 |
0.2.3 | 302 | 12/21/2022 |
0.2.2 | 304 | 12/21/2022 |
0.2.1 | 288 | 12/21/2022 |
0.2.0 | 300 | 12/19/2022 |
0.1.2 | 311 | 12/19/2022 |
0.1.1 | 322 | 12/19/2022 |
0.1.0 | 303 | 12/18/2022 |
0.0.3 | 344 | 12/16/2022 |
0.0.2 | 313 | 12/16/2022 |
0.0.1 | 305 | 12/16/2022 |