Rask.Data 0.20.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Rask.Data --version 0.20.0
                    
NuGet\Install-Package Rask.Data -Version 0.20.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="Rask.Data" Version="0.20.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rask.Data" Version="0.20.0" />
                    
Directory.Packages.props
<PackageReference Include="Rask.Data" />
                    
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 Rask.Data --version 0.20.0
                    
#r "nuget: Rask.Data, 0.20.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 Rask.Data@0.20.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=Rask.Data&version=0.20.0
                    
Install as a Cake Addin
#tool nuget:?package=Rask.Data&version=0.20.0
                    
Install as a Cake Tool

Rask.Data

A tiny, provider-agnostic data layer for Entity Framework Core apps — the DDD building blocks the rask generate feature scaffolder emits, packaged for reuse.

  • Entity<TId> — a base entity with Id, audit stamps (CreatedAt/UpdatedAt), and a domain-events buffer.
  • Opt-in markers — implement ISoftDeletable (adds DeletedAt) or IVersioned (adds a Version concurrency token) on your entity to turn on the behavior.
  • Three ISaveChangesInterceptors — auditing timestamps, transparent soft delete (a Remove becomes a DeletedAt stamp behind a global query filter), and after-commit domain-event publication through Rask.Cqrs.

Use

public sealed class Product : Entity<Guid>, ISoftDeletable, IVersioned
{
    public string Name { get; private set; } = "";
    public DateTime? DeletedAt { get; private set; }
    public int Version { get; private set; }

    public static Product Create(string name) => new() { Id = Guid.NewGuid(), Name = name };
}

// Program.cs
builder.Services.AddRaskCqrs();
builder.Services.AddRaskData();
builder.Services.AddDbContextFactory<AppDbContext>((sp, o) => o
    .UseSqlite("Data Source=app.db")
    .AddInterceptors(sp.GetServices<ISaveChangesInterceptor>()));

// AppDbContext.OnModelCreating
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
    modelBuilder.ApplyRaskConventions();
}

db.Remove(product) now soft-deletes; deleted rows drop out of queries (use IgnoreQueryFilters() to restore); a save against a stale Version throws DbUpdateConcurrencyException; and any INotification raised on the entity is published after the change commits.

Part of the Rask framework. MIT licensed.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Rask.Data:

Package Downloads
Rask.SQLite.EntityFrameworkCore

The Entity Framework Core integration for Rask.SQLite: `UseRaskSqlite(...)`, a drop-in replacement for `UseSqlite` that also registers a `ConnectionOpened` interceptor applying the production pragma set (WAL, `synchronous=NORMAL`, `foreign_keys=ON`, a `busy_timeout`, `mmap_size`, `journal_size_limit`) to every connection the context opens. Split out from Rask.SQLite so apps that only need the raw `Microsoft.Data.Sqlite` path (or run on mobile/AOT) don't pull in Entity Framework Core.

Rask.Outbox

A transactional outbox for Rask.Data entities: domain events marked `IOutboxEvent` are written to an `OutboxMessage` table in the **same transaction** as the change that raised them (so an event is never lost and never fires for a rolled-back change), then a background `OutboxProcessor` polls the table and publishes them through Rask.Cqrs — at-least-once, crash-safe delivery, all on the app's own database (no broker, no Redis). A source generator registers each event type for reflection-free lookup. Server-side; pairs with Rask.Data.

Rask

The one reference a Rask application needs, server or browser. On net10.0 it brings the ASP.NET host plus every battery — database, mediator, background jobs, transactional email, cache, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On net10.0-browser it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.20.1-alpha.0.228 36 9/4/2026
0.20.1-alpha.0.227 34 9/4/2026
0.20.1-alpha.0.226 35 9/4/2026
0.20.1-alpha.0.225 40 9/4/2026
0.20.1-alpha.0.224 47 9/4/2026
0.20.1-alpha.0.223 40 9/4/2026
0.20.1-alpha.0.221 39 9/4/2026
0.20.1-alpha.0.220 43 9/4/2026
0.20.1-alpha.0.217 33 9/4/2026
0.20.1-alpha.0.216 40 9/4/2026
0.20.1-alpha.0.215 43 9/3/2026
0.20.1-alpha.0.213 38 9/3/2026
0.20.1-alpha.0.212 47 9/3/2026
0.20.1-alpha.0.211 46 9/3/2026
0.20.1-alpha.0.210 49 9/3/2026
0.20.1-alpha.0.209 42 9/2/2026
0.20.1-alpha.0.208 47 9/2/2026
0.20.1-alpha.0.207 50 9/2/2026
0.20.1-alpha.0.206 48 9/2/2026
0.20.0 127 8/6/2026
Loading failed