Basilisque.AutoImplementer.CodeAnalysis.Fasteroid
1.1.0-F
dotnet add package Basilisque.AutoImplementer.CodeAnalysis.Fasteroid --version 1.1.0-F
NuGet\Install-Package Basilisque.AutoImplementer.CodeAnalysis.Fasteroid -Version 1.1.0-F
<PackageReference Include="Basilisque.AutoImplementer.CodeAnalysis.Fasteroid" Version="1.1.0-F" />
paket add Basilisque.AutoImplementer.CodeAnalysis.Fasteroid --version 1.1.0-F
#r "nuget: Basilisque.AutoImplementer.CodeAnalysis.Fasteroid, 1.1.0-F"
// Install Basilisque.AutoImplementer.CodeAnalysis.Fasteroid as a Cake Addin #addin nuget:?package=Basilisque.AutoImplementer.CodeAnalysis.Fasteroid&version=1.1.0-F&prerelease // Install Basilisque.AutoImplementer.CodeAnalysis.Fasteroid as a Cake Tool #tool nuget:?package=Basilisque.AutoImplementer.CodeAnalysis.Fasteroid&version=1.1.0-F&prerelease
Basilisque - Auto Implementer
Overview
This project provides functionality to automatically implement interfaces.
Description
This project contains a source generator that automatically implements interface members in classes implementing the interfaces.
The goal is to provide a workaround for C# not supporting multiple inheritance for some basic use cases.
Getting Started
Install the NuGet package Basilisque.AutoImplementer.
Installing the package will add the source generator to your project.
Now you're ready to start implementing your interfaces automatically.
Features
- Properties of interfaces will be added as auto-implemented properties
Examples
Create the interfaces:
[AutoImplementable()]
public interface ITitle
{
[Required] string Title { get; set; } // implements 'Title' as 'required' in .NET 7.0+
}
[AutoImplementable()]
public interface IDetails
{
byte[]? Image { get; set; }
string Summary { get; set; }
}
Create some classes implementing the interfaces:
public partial class Book : ITitle, IDetails
{ /* will have the properties Title, Image and Summary */ }
public partial class Movie : ITitle, IDetails
{ /* will have the properties Title, Image and Summary */ }
public partial class Song: ITitle
{ /* will have the property Title */ }
The source generator now adds the members to the corresponding classes without you having to do this on your own every time.
For details see the wiki.
License
The Basilisque framework (including this repository) is licensed under the Apache License, Version 2.0.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Basilisque.CodeAnalysis.TestSupport.MSTest (>= 1.0.0-RC25)
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.1.0-F | 42 | 12/5/2024 |