Muslim.EntityAndDto
10.0.1
dotnet add package Muslim.EntityAndDto --version 10.0.1
NuGet\Install-Package Muslim.EntityAndDto -Version 10.0.1
<PackageReference Include="Muslim.EntityAndDto" Version="10.0.1" />
<PackageVersion Include="Muslim.EntityAndDto" Version="10.0.1" />
<PackageReference Include="Muslim.EntityAndDto" />
paket add Muslim.EntityAndDto --version 10.0.1
#r "nuget: Muslim.EntityAndDto, 10.0.1"
#:package Muslim.EntityAndDto@10.0.1
#addin nuget:?package=Muslim.EntityAndDto&version=10.0.1
#tool nuget:?package=Muslim.EntityAndDto&version=10.0.1
Muslim.EntityAndDto
Base classes for entities and DTOs in .NET 10: an Id, audit fields and soft-delete fields,
written once and shared by every table in your application.
dotnet add package Muslim.EntityAndDto
Quick start
using Muslim.EntityAndDto.Entitys;
using Muslim.EntityAndDto.Dtos;
public class Product : Entity
{
public string Name { get; set; } = "";
public decimal Price { get; set; }
}
public class ProductDto : Dto
{
public string Name { get; set; } = "";
public decimal Price { get; set; }
}
Product now has everything a table usually needs:
var product = new Product
{
Name = "Coffee",
Price = 4.5m,
CreatedDate = DateTime.UtcNow,
CreatedBy = "admin"
};
// later, a soft delete
product.IsDeleted = true;
product.DeletedDate = DateTime.UtcNow;
product.DeletedBy = "admin";
What each class gives you
| Class | Fields |
|---|---|
Entity |
Id, CreatedDate, CreatedBy, UpdateDate, UpdateBy, IsDeleted, DeletedDate, DeletedBy |
EntityBase |
everything in Entity except Id, DeletedDate and DeletedBy |
SuperBase |
CreatedDate, CreatedBy, UpdateDate, UpdateBy |
Dto |
Id |
IdNameDto |
Id, Name — handy for drop-down lists |
Auditable |
all Entity fields in a standalone, non-abstract class |
Interfaces for generic code:
| Interface | Implemented by |
|---|---|
IDBase (Id) |
Entity, Dto, Auditable |
IEntity (CreatedDate) |
EntityBase, Entity, Auditable |
IDto |
Dto |
Entity also implements IHaveFilter, so every entity can be filtered with
Muslim.Filter without extra code.
Good to know
- These are plain classes. Nothing fills the fields for you: set
CreatedDate,CreatedByand the rest in your repository orSaveChangesoverride. - The fields are independent. Setting
DeletedDatedoes not setIsDeleted. - No database rules are included here. For table defaults and the soft-delete query filter, use Muslim.ConfigureTable.
- No dependency-injection setup is needed.
Related packages
| Package | Use it for |
|---|---|
| Muslim.ConfigureTable | EF Core table defaults for those entities |
| Muslim.Filter | Filtering, sorting and paging |
Coding-agent guidance
When you build a project that uses this package, a short guide for AI coding agents is copied to
.agents/skills/muslim.entityanddto/ at the root of your repository. Agents that read skills from
.agents/skills, such as Codex and GitHub Copilot in VS Code, use it to write correct code against
this package. Your own files and other skills are never touched, and nothing is deleted
automatically.
To turn it off, add this to your project or Directory.Build.props:
<PropertyGroup>
<MuslimEntityAndDtoGenerateSkill>false</MuslimEntityAndDtoGenerateSkill>
</PropertyGroup>
License
See LICENSE.txt.
| Product | Versions 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. |
-
net10.0
- Muslim.Filter (>= 10.0.1)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Muslim.EntityAndDto:
| Package | Downloads |
|---|---|
|
Muslim.GenericRepository
EF Core repository for entities with audit columns: reads, writes, soft delete, bulk operations and raw SQL, with CreatedBy/UpdateBy/DeletedBy and UTC timestamps written automatically. Implements Muslim.GenericRepository.Interface. |
|
|
Muslim.ConfigureTable
EF Core entity configuration defaults and context-scoped nested configuration discovery, with build-delivered agent guidance. |
|
|
Muslim.GenericRepository.Interface
Repository abstraction over EF Core: IRepository<TEntity> and the interfaces it composes — reads, writes, soft delete, bulk operations, counts and raw SQL. Reference this to depend on the contract without the implementation. |
|
|
Muslim.GenericService.Interface
Service abstraction for Muslim.GenericService: IService<TEntity> and the interfaces it composes — reads, finds with paging, create, update, delete, soft delete and restore, counts and raw SQL — all returning Muslim.Result Result<T>. Reference this to depend on the contract without the implementation. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Portable package output; documented contracts; EntityBase and Auditable implement IEntity, and Auditable implements IDBase. Property and JSON contracts are unchanged. Includes optional build-time skill delivery.