DragonFruit.Data.Roslyn 4.0.0

dotnet add package DragonFruit.Data.Roslyn --version 4.0.0
NuGet\Install-Package DragonFruit.Data.Roslyn -Version 4.0.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="DragonFruit.Data.Roslyn" Version="4.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DragonFruit.Data.Roslyn --version 4.0.0
#r "nuget: DragonFruit.Data.Roslyn, 4.0.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 DragonFruit.Data.Roslyn as a Cake Addin
#addin nuget:?package=DragonFruit.Data.Roslyn&version=4.0.0

// Install DragonFruit.Data.Roslyn as a Cake Tool
#tool nuget:?package=DragonFruit.Data.Roslyn&version=4.0.0

DragonFruit.Data.Roslyn

A Roslyn source-generator and code-analyzer for DragonFruit.Data

Latest Nuget DragonFruit Discord

Overview

DragonFruit.Data.Roslyn is a source-generator and code-analyzer for DragonFruit.Data that allows the request-building logic for ApiRequest classes to be generated at compile-time, rather than at runtime for each request. It also provides code-analysis to ensure attributes are applied correctly and design rules are followed.

Usage/Getting Started

Note: while semantic versioning is used, it is best to ensure the versions of DragonFruit.Data and DragonFruit.Data.Roslyn are the same.

The easiest way to get started is to install the NuGet package alongside DragonFruit.Data and start writing ApiRequest classes. The analyzer will inform you of any issues through your IDE.

Because the source generator writes code that is written at compile time, additional constraints are applied to ApiRequest classes:

  • Classes must be marked with the partial keyword
  • Classes must not be nested within another class
  • Members cannot be marked as private or internal (only public and protected and internal protected are allowed)

Additionally, if a library uses the source generator, it must be added to all consumers unless all requests are sealed. This is due to how the source generator works in combination with how DragonFruit.Data prioritises source-generated request builders.

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
4.0.0 341 12/19/2023
0.9.3-beta 153 12/17/2023