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 (1)

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

Package Downloads
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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.20.1-alpha.0.2 0 8/6/2026
0.20.0 0 8/6/2026
0.19.1-alpha.0.75 0 8/6/2026
0.19.1-alpha.0.74 0 8/6/2026
0.19.1-alpha.0.73 0 8/6/2026
0.19.1-alpha.0.69 0 8/6/2026
0.19.1-alpha.0.68 0 8/6/2026
0.19.1-alpha.0.67 0 8/6/2026
0.19.1-alpha.0.66 0 8/6/2026
0.19.1-alpha.0.64 0 8/6/2026
0.19.1-alpha.0.62 27 8/5/2026
0.19.1-alpha.0.57 27 8/5/2026
0.19.1-alpha.0.51 26 8/5/2026
0.19.1-alpha.0.43 26 8/5/2026
0.19.1-alpha.0.42 31 8/5/2026
0.19.1-alpha.0.40 25 8/5/2026
0.19.1-alpha.0.38 27 8/5/2026
0.19.1-alpha.0.32 31 8/5/2026
0.19.1-alpha.0.31 32 8/4/2026
0.19.1-alpha.0.30 35 8/4/2026
Loading failed