NuvTools.AspNetCore.EntityFrameworkCore 10.0.0

dotnet add package NuvTools.AspNetCore.EntityFrameworkCore --version 10.0.0
                    
NuGet\Install-Package NuvTools.AspNetCore.EntityFrameworkCore -Version 10.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="NuvTools.AspNetCore.EntityFrameworkCore" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NuvTools.AspNetCore.EntityFrameworkCore" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NuvTools.AspNetCore.EntityFrameworkCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NuvTools.AspNetCore.EntityFrameworkCore --version 10.0.0
                    
#r "nuget: NuvTools.AspNetCore.EntityFrameworkCore, 10.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.
#:package NuvTools.AspNetCore.EntityFrameworkCore@10.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NuvTools.AspNetCore.EntityFrameworkCore&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NuvTools.AspNetCore.EntityFrameworkCore&version=10.0.0
                    
Install as a Cake Tool

NuvTools ASP.NET Core Libraries

NuGet License: MIT

A suite of helper libraries designed to simplify and enhance ASP.NET Core application development. These libraries target modern .NET platforms, including .NET 8, .NET 9, and .NET 10.

Libraries

NuvTools.AspNetCore

A general-purpose library providing common helpers for ASP.NET Core applications.

Key Features:

  • Composite Localization: Multi-source localization with prefix-based routing and fallback resolution
  • AutoMapper Integration: Base classes for services with built-in DTO/Entity mapping
  • JavaScript Interop: Clipboard operations for Blazor applications
  • Fully documented with XML comments for IntelliSense support

NuvTools.AspNetCore.EntityFrameworkCore

A specialized library offering Entity Framework Core helpers for ASP.NET Core projects.

Key Features:

  • CRUD Base Classes: Pre-built service base classes with complete CRUD operations
  • Database Migration Extensions: Automatic migration application with configurable timeouts
  • AutoMapper + EF Integration: Seamless DTO/Entity conversion with database operations
  • Built on top of NuvTools.AspNetCore for maximum code reuse

Installation

Install via NuGet Package Manager:

# For general ASP.NET Core helpers
dotnet add package NuvTools.AspNetCore

# For Entity Framework Core helpers (includes NuvTools.AspNetCore)
dotnet add package NuvTools.AspNetCore.EntityFrameworkCore

Or via Package Manager Console:

Install-Package NuvTools.AspNetCore
Install-Package NuvTools.AspNetCore.EntityFrameworkCore

Quick Start

Composite Localization

Set up multiple localization sources with prefix-based routing:

// In Program.cs or Startup.cs
services.AddCompositeLocalizer(
    namedResourceTypes: new Dictionary<string, Type>
    {
        ["Errors"] = typeof(ErrorResources),
        ["Messages"] = typeof(MessageResources)
    },
    unnamedResourceTypes: new[] { typeof(SharedResources) }
);

// In your code
public class MyService
{
    private readonly CompositeLocalizer _localizer;

    public MyService(CompositeLocalizer localizer)
    {
        _localizer = localizer;
    }

    public string GetMessage()
    {
        // Use prefix to target specific localizer
        var error = _localizer["Errors:ValidationFailed"];

        // Or let it search all localizers
        var message = _localizer["WelcomeMessage"];

        return message;
    }
}

AutoMapper Service Base

Create services with built-in mapping:

public class ProductService : ServiceWithMapperBase<ProductDto, Product>
{
    public ProductService(IMapper mapper) : base(mapper) { }

    public ProductDto Convert(Product product)
    {
        return ConvertToDTO(product);
    }

    public IEnumerable<ProductDto> ConvertAll(IEnumerable<Product> products)
    {
        return ConvertToDTO(products);
    }
}

CRUD Service Base

Create full CRUD services with minimal code:

public class CustomerService : ServiceWithCrudBase<MyDbContext, CustomerDto, Customer, int>
{
    public CustomerService(MyDbContext context, IMapper mapper)
        : base(context, mapper) { }

    // FindAsync, AddAndSaveAsync, UpdateAndSaveAsync, RemoveAndSaveAsync
    // are already implemented!

    public async Task<CustomerDto?> GetCustomerById(int id)
    {
        return await FindAsync(id);
    }
}

Database Migrations

Apply migrations automatically on startup:

// In Program.cs
var app = builder.Build();

// Apply migrations with default timeout
app.DatabaseMigrate<MyDbContext>();

// Or with custom timeout
app.DatabaseMigrate<MyDbContext>(TimeSpan.FromMinutes(5));

app.Run();

Clipboard Service (Blazor)

Use JavaScript interop for clipboard operations:

@inject ClipboardService ClipboardService

<button @onclick="CopyToClipboard">Copy</button>
<button @onclick="PasteFromClipboard">Paste</button>

@code {
    private async Task CopyToClipboard()
    {
        await ClipboardService.WriteTextAsync("Hello, World!");
    }

    private async Task PasteFromClipboard()
    {
        var text = await ClipboardService.ReadTextAsync();
        Console.WriteLine(text);
    }
}

Features

  • Multi-targeting: Compatible with .NET 8, .NET 9, and .NET 10
  • Strong-named assemblies: Signed for use in fully trusted environments
  • Comprehensive documentation: Full XML documentation for IntelliSense
  • Modular design: Use only what you need
  • Best practices: Promotes clean architecture patterns
  • Modern C# features: Uses nullable reference types, implicit usings, and primary constructors

Building from Source

This project uses the modern .slnx solution format (Visual Studio 2022 v17.11+).

# Clone the repository
git clone https://github.com/nuvtools/nuvtools-aspnetcore.git
cd nuvtools-aspnetcore

# Build the solution
dotnet build NuvTools.AspNetCore.slnx

# Run tests
dotnet test NuvTools.AspNetCore.slnx

# Create release packages
dotnet build NuvTools.AspNetCore.slnx --configuration Release

Requirements

  • .NET 8.0 SDK or higher
  • Visual Studio 2022 (v17.11+) or Visual Studio Code with C# extension
  • AutoMapper 16.0.0+

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
10.0.0 100 12/6/2025
9.5.0 187 10/26/2025
9.2.0 812 5/22/2025
9.1.0 247 4/10/2025
9.0.9 157 2/5/2025
9.0.4 134 1/3/2025
9.0.3 163 11/24/2024
9.0.2 147 11/22/2024
9.0.0 145 11/13/2024
8.1.0 203 9/15/2024
8.0.3 361 3/5/2024
8.0.2 198 2/14/2024
8.0.0 177 2/14/2024
7.1.0 264 9/10/2023
7.0.1 252 8/27/2023
7.0.0 361 2/27/2023