SplatDev.Umbraco.EntityFramework 2.0.5

dotnet add package SplatDev.Umbraco.EntityFramework --version 2.0.5
                    
NuGet\Install-Package SplatDev.Umbraco.EntityFramework -Version 2.0.5
                    
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="SplatDev.Umbraco.EntityFramework" Version="2.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SplatDev.Umbraco.EntityFramework" Version="2.0.5" />
                    
Directory.Packages.props
<PackageReference Include="SplatDev.Umbraco.EntityFramework" />
                    
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 SplatDev.Umbraco.EntityFramework --version 2.0.5
                    
#r "nuget: SplatDev.Umbraco.EntityFramework, 2.0.5"
                    
#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 SplatDev.Umbraco.EntityFramework@2.0.5
                    
#: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=SplatDev.Umbraco.EntityFramework&version=2.0.5
                    
Install as a Cake Addin
#tool nuget:?package=SplatDev.Umbraco.EntityFramework&version=2.0.5
                    
Install as a Cake Tool

SplatDev.Umbraco.EntityFramework

Entity Framework Core integration for Umbraco — provides the IRepository<TEntity> abstraction with DbContextRepository<TEntity>, second-level caching, pagination, raw SQL execution, and AsNoTracking reads. Designed for Umbraco applications that need EF Core data access alongside the Umbraco NPoco pipeline.

NuGet License: MIT

Compatibility

.NET Umbraco EF Core Package Version
8.0 13 8.0.20 1.0.0
10.0 17 10.0.7 1.0.0

Installation

dotnet add package SplatDev.Umbraco.EntityFramework

Configuration

DI registration

using SplatDev.Umbraco.EntityFramework;
using Microsoft.EntityFrameworkCore;

// Register your DbContext
builder.Services.AddDbContext<MyDbContext>(options =>
    options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));

// Register the repository
builder.Services.AddScoped<IRepository<MyEntity>, DbContextRepository<MyEntity>>();

// Add second-level caching
builder.Services.AddEFCoreSecondLevelCache(options =>
{
    options.UseMemoryCacheProvider();
    options.CacheAllQueries(CacheExpirationMode.Absolute, TimeSpan.FromMinutes(30));
});

Usage

Basic CRUD

using SplatDev.Umbraco.EntityFramework;

public class ProductService
{
    private readonly IRepository<Product> _repo;

    public ProductService(IRepository<Product> repo) => _repo = repo;

    public async Task<Product> GetByIdAsync(int id)
        => await _repo.GetByIdAsync(id);

    public async Task<IEnumerable<Product>> GetAllAsync()
        => await _repo.GetAllAsync();

    public async Task AddAsync(Product product)
        => await _repo.AddAsync(product);

    public async Task UpdateAsync(Product product)
        => await _repo.UpdateAsync(product);

    public async Task DeleteAsync(Product product)
        => await _repo.DeleteAsync(product);
}

Paginated queries

// Returns PagedResults<T> from SplatDev.Umbraco.Pagination
var paged = await _repo.GetPagedAsync(
    page: 1,
    pageSize: 20,
    filter: p => p.IsActive,
    orderBy: q => q.OrderBy(p => p.CreatedAt));

Raw SQL

// Execute raw SQL with parameterized queries
var products = await _repo.FromSqlRawAsync(
    "SELECT * FROM Products WHERE Price > @0", 100);

// Execute non-query SQL
await _repo.ExecuteSqlRawAsync(
    "UPDATE Products SET IsActive = 0 WHERE LastUpdated < @0",
    DateTime.UtcNow.AddDays(-365));

Second-level caching

Queries decorated with the EFCoreSecondLevelCacheInterceptor are automatically cached:

// This result is cached for the configured duration
var categories = await _dbContext.Categories
    .Cacheable()
    .ToListAsync();

// Bypass cache when needed
var fresh = await _dbContext.Categories
    .NotCacheable()
    .ToListAsync();

AsNoTracking reads

// Read-only queries use AsNoTracking for performance
var readOnly = await _repo.GetAllNoTrackingAsync();

Features

  • IRepository<TEntity> interface for testable, injectable data access
  • DbContextRepository<TEntity> implementation with full CRUD operations
  • Second-level caching via EFCoreSecondLevelCacheInterceptor (v5.3.2)
  • Built-in pagination via SplatDev.Umbraco.Pagination returning PagedResults<T>
  • Raw SQL support: FromSqlRawAsync and ExecuteSqlRawAsync
  • AsNoTracking read-only queries for performance
  • Works alongside Umbraco's native NPoco pipeline

Dependencies

Package Purpose
Microsoft.EntityFrameworkCore (v8.0.20 / v10.0.7) EF Core ORM
EFCoreSecondLevelCacheInterceptor (v5.3.2) Second-level query caching
Umbraco.Cms.Core Umbraco core APIs
SplatDev.Umbraco.Pagination PagedResults<T> and pagination utilities

Target Frameworks

  • net8.0 — for Umbraco 13 applications (EF Core 8.0.20)
  • net10.0 — for Umbraco 17 applications (EF Core 10.0.7)

SplatDev.Umbraco.EntityFramework — part of the SplatDev.Umbraco.Plugins suite. Licensed under MIT. © SplatDev Ltda.

Changelog

2.0.5 — 2026-08-24

Removes a dashboard screenshot that showed an error toast. It was captured against a site where this plugin's API was unreachable, so it advertised a broken dashboard. No screenshot is better than a misleading one; a replacement will be taken against a working install.

2.0.4 — 2026-08-24

Package metadata only: the listing now carries an icon and search tags, and the project and repository links point at the organisation that actually hosts this code. No code changes.

2.0.2 — 2026-08-22

  • This package's README now reaches NuGet. The publish workflow discovered packages by a list of name patterns, and this one matched none of them, so it was never built or pushed by CI — the version on NuGet was placed there by hand before the README was wired up, and no release could refresh it. Discovery is now by prefix, so the package ships whenever the repo is tagged.
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 was computed.  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
2.0.5 88 8/24/2026