From arbiter-skills
Wires Arbiter.CommandQuery with Entity Framework Core, registering add-entity-queries/commands, defining DbContext-backed handlers, and implementing audited/soft-delete/tenant entities.
How this skill is triggered — by the user, by Claude, or both
Slash command
/arbiter-skills:arbiter-commandquery-efThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
EF Core implementations of the generic `Arbiter.CommandQuery` handlers. Provides ready-made handlers for `EntityIdentifierQuery`, `EntityPagedQuery`, and the create/update/patch/delete commands against a `DbContext`.
EF Core implementations of the generic Arbiter.CommandQuery handlers. Provides ready-made handlers for EntityIdentifierQuery, EntityPagedQuery, and the create/update/patch/delete commands against a DbContext.
dotnet add package Arbiter.CommandQuery.EntityFramework
Pairs with Arbiter.CommandQuery (base) and Arbiter.Mapping (read/update model mapping).
using Arbiter.CommandQuery;
using Arbiter.CommandQuery.EntityFramework;
// EF Core DbContext
services.AddDbContext<TrackerContext>(o => o.UseSqlServer(connectionString));
// CQRS + mapping
services.AddCommandQuery();
services.AddSingleton<IMapper, ServiceProviderMapper>();
services.AddSingleton<IMapper<Product, ProductReadModel>, ProductToReadModelMapper>();
services.AddSingleton<IMapper<ProductCreateModel, Product>, ProductCreateModelToProductMapper>();
services.AddSingleton<IMapper<ProductUpdateModel, Product>, ProductUpdateModelToProductMapper>();
// Per-entity registration
services.AddEntityQueries <TrackerContext, Product, int, ProductReadModel>();
services.AddEntityCommands<TrackerContext, Product, int, ProductReadModel, ProductCreateModel, ProductUpdateModel>();
AddEntityQueries registers identifier, identifiers, and paged-query handlers.
AddEntityCommands registers create, update, patch, and delete handlers.
public class Product : IHaveIdentifier<int>,
ITrackCreated, ITrackUpdated, // audit fields
ITrackDeleted // soft delete
{
public int Id { get; set; }
public string Name { get; set; } = "";
public decimal Price { get; set; }
public DateTimeOffset Created { get; set; }
public string? CreatedBy { get; set; }
public DateTimeOffset Updated { get; set; }
public string? UpdatedBy { get; set; }
public bool IsDeleted { get; set; }
}
Implementing IHaveIdentifier<TKey> is required. The other marker interfaces opt the entity into audit and soft-delete behaviors automatically — paged queries filter out soft-deleted rows; commands stamp audit fields from the ClaimsPrincipal.
Use these if you don't want every CRUD operation, or you want a custom handler for one:
// Queries
services.AddEntityIdentifierQuery <int, ProductReadModel, MyHandler>();
services.AddEntityIdentifiersQuery<int, ProductReadModel, MyHandler>();
services.AddEntityPagedQuery <ProductReadModel, MyHandler>();
// Commands (DbContext-backed)
services.AddEntityCreateCommand<TrackerContext, Product, int, ProductReadModel, ProductCreateModel>();
services.AddEntityUpdateCommand<TrackerContext, Product, int, ProductReadModel, ProductUpdateModel>();
services.AddEntityPatchCommand <TrackerContext, Product, int, ProductReadModel>();
services.AddEntityDeleteCommand<TrackerContext, Product, int, ProductReadModel>();
// Commands (custom handler)
services.AddEntityCreateCommand<int, ProductReadModel, ProductCreateModel, MyCreateHandler>();
AddQueryPipeline() registers EF-specific pipeline pieces (call once; included automatically by the helpers above).
// Entity implements IHaveKey + IHaveIdentifier<TKey>
services.AddEntityKeyQuery<TrackerContext, Product, ProductReadModel>();
npx claudepluginhub loresoft/arbiter --plugin arbiter-skillsProvides pre-built generic CQRS commands and queries for entity CRUD with filter/sort/paging and pipeline behaviors (validation, cache, audit, tenant, soft-delete) for .NET applications.
Entity Framework Core patterns for .NET 10: DbContext configuration, migrations, interceptors, compiled queries, ExecuteUpdateAsync/ExecuteDeleteAsync, value converters, and query optimization.
Guides ABP Framework v10.x EF Core integration: DbContext setup, entity mapping with ConfigureByConvention, repository registration, and DBMS selection (PostgreSQL/MySQL/SQLite/Oracle).