Centeva.Mason.EntityFrameworkCore
4.0.0
Prefix Reserved
dotnet add package Centeva.Mason.EntityFrameworkCore --version 4.0.0
NuGet\Install-Package Centeva.Mason.EntityFrameworkCore -Version 4.0.0
<PackageReference Include="Centeva.Mason.EntityFrameworkCore" Version="4.0.0" />
<PackageVersion Include="Centeva.Mason.EntityFrameworkCore" Version="4.0.0" />
<PackageReference Include="Centeva.Mason.EntityFrameworkCore" />
paket add Centeva.Mason.EntityFrameworkCore --version 4.0.0
#r "nuget: Centeva.Mason.EntityFrameworkCore, 4.0.0"
#:package Centeva.Mason.EntityFrameworkCore@4.0.0
#addin nuget:?package=Centeva.Mason.EntityFrameworkCore&version=4.0.0
#tool nuget:?package=Centeva.Mason.EntityFrameworkCore&version=4.0.0
Mason Document Generator
Mason is an opinionated template-based document generator using the Aspose.Words library as its rendering engine.
Requirements
The Mason library supports .NET 10+.
Setup
For best results, you should wire up Mason using your favorite dependency injection container. This tells Mason where to find your choice of template and data provider.
Microsoft.Extensions.DependencyInjection
builder.Services.AddTransient<ITemplateRepository, Centeva.Mason.EntityFramework.TemplateRepository>();
builder.Services.AddTransient<IDocumentGenerator, Centeva.Mason.DocumentGenerator>();
builder.Services.AddTransient<IDataProvider, Centeva.Mason.EntityFramework.DataProvider>();
builder.Services.AddTransient<IMasonContext, MyDbContext>();
Basic Usage
Entity Framework 6
Your DbContext class should implement the IMasonContext interface.
Entity Framework Core
Use the Centeva.Mason.EntityFrameworkCore package. Your DbContext class should implement its IMasonContext
interface and call modelBuilder.ConfigureMason() in OnModelCreating. Register the Entity Framework Core
types instead of the Entity Framework 6 ones shown above:
builder.Services.AddScoped<ITemplateRepository, Centeva.Mason.EntityFrameworkCore.TemplateRepository>();
builder.Services.AddScoped<IDocumentGenerator, Centeva.Mason.DocumentGenerator>();
builder.Services.AddScoped<IDataProvider>(sp => new Centeva.Mason.EntityFrameworkCore.DataProvider(sp.GetRequiredService<MyDbContext>()));
builder.Services.AddScoped<Centeva.Mason.EntityFrameworkCore.IMasonContext>(sp => sp.GetRequiredService<MyDbContext>());
Reserved Template Data
Templates are automatically provided with the following values. You should avoid using these names as data sources.
generator- an instance of the DocumentGenerator, used to include sub- documents into the template.parameters- a Dictionary containing the parameters that were passed to the DocumentGenerator.GenerateDocument() method.
Releasing
All four packages (Centeva.Mason, Centeva.Mason.Core, Centeva.Mason.EntityFramework and
Centeva.Mason.EntityFrameworkCore) share one version. To release, publish a GitHub release on master
with a new tag vX.Y.Z; the tag sets the version. A stable release publishes to nuget.org, and a
pre-release publishes to GitHub Packages. Record the changes in CHANGELOG.md first.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Centeva.Mason.Core (>= 4.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.0)
- Microsoft.EntityFrameworkCore.InMemory (>= 10.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0)
- VeracodeAttributes (>= 1.2.1)
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 | 137 | 11/17/2026 |
| 3.0.0 | 346 | 1/10/2025 |
| 3.0.0-pre.2 | 158 | 12/19/2024 |
| 3.0.0-pre.1 | 181 | 12/17/2024 |