Maestria.TypeProviders 1.0.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Maestria.TypeProviders --version 1.0.10                
NuGet\Install-Package Maestria.TypeProviders -Version 1.0.10                
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="Maestria.TypeProviders" Version="1.0.10">
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Maestria.TypeProviders --version 1.0.10                
#r "nuget: Maestria.TypeProviders, 1.0.10"                
#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 Maestria.TypeProviders as a Cake Addin
#addin nuget:?package=Maestria.TypeProviders&version=1.0.10

// Install Maestria.TypeProviders as a Cake Tool
#tool nuget:?package=Maestria.TypeProviders&version=1.0.10                

Maestria Type Providers

Build status NuGet MyGet Apimundo

Build History


What is Maestria Type Providers?

Source Generator pack to increase productivity and improve source code writing.

How install and configure package?

First, install Maestria Type Providers from the dotnet cli command line:

dotnet add package Maestria.TypeProviders

Providers x Dependencies

This package does not include dependencies references when installed on your project, its only generate source code files.
You need install thirds dependencies to compile your project according to the features used, bellow instructions of source generator providers:

  • ExcelProvider: Generated strong data sctruct and factory class to load xls/xlsx data.
  • OpenApiProvider: Generate HTTP client from OpenApi / Swagger specification.


Generate strong data struct and class factory to load excel data from xls/xlsx template.

Attribute: ExcelProvider


Dependencies install

dotnet add package Maestria.FluentCast
dotnet add package ClosedXML

Source code sample

Use case sample

// The relative path is based at the source code file location.
// In this example the first page was used as none were explicitly entered.
[ExcelProvider(TemplatePath = @"../../resources/Excel.xlsx")]
public partial class MyExcelData

var data = MyExcelDataFactory.Load(filePath);
foreach (var item in data)
  // Access strong typing by "item.<field-name>"

Use case sample two

// The relative path is based at the source code file location.
// Loadind data struct from second page
[ExcelProvider(TemplatePath = @"../../resources/Excel.xlsx", SheetName = "Plan2")]
public partial class MyExcelData

var data = MyExcelDataFactory.Load(filePath, "Plan2");
foreach (var item in data)
  // Access strong typing by "item.<field-name>"

Generator engine:

  • Nullable types: To create a nullable property, seed excel template file with one row cell empty, and another not empty.
  • Decimal types: To create decimal property, seed one row of cell with floating point value.

Good practices: Don't use big file by template, this file is used always you need recreated source code. Big file impact is slow build time.


Provider to generate source code HTTP client from OpenApi / Swagger specification.

It's planned used NSwagStudio engine with .NET 5 source generator.
This package allows automatized generation code.

...As soon as possible


Optional configuration in VS Code: To view the automatically generated codes it is necessary to indicate to write it to disk with the configuration in the .csproj file.
On CompilerGeneratedFilesOutputPath property its configured with /../generated/$(MSBuildProjectName). This folder is one level above of file project on this sample.
This mode allow see generated files, but not works go to navigation feature of VS Code.


Optional configuration in VS Code: To allow go to navigation feature you need write files at solution level.

Problem's: The source code generated will be used on next build, to solve problems of duplicated classes, it's need removed generated files before build.
On next build, if there was no change on yout source code used by generators, the files has no generated. You need force a rebuild with dotnet build --no-incremental <args> to regenerate files.


<Target Name="ExcludeGenerated" BeforeTargets="AssignTargetPaths">
        <Generated Include="/generated/**/*.cs" />
        <Compile Remove="@(Generated)" />
    <Delete Files="@(Generated)" />

Sample of .csproj file

buy-me-a-coffee smile.png

If my contributions helped you, please help me buy a coffee 😄


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.1.2 423 8/27/2022
1.1.1 373 8/27/2022
1.1.0 361 8/27/2022
1.0.10 355 8/27/2022
1.0.8 413 5/11/2022
1.0.7 329 7/26/2021
1.0.6 347 6/23/2021
1.0.5 334 6/7/2021
1.0.4 273 5/20/2021
1.0.2 298 5/20/2021
1.0.1 301 5/20/2021
1.0.0 304 5/19/2021
0.0.14 334 5/10/2021