alaasmagi.Base.Application 1.1.2

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

alaasmagi Base Packages

Reusable base-layer building blocks for .NET applications.

This package set provides shared contracts and generic implementations for common layers:

  • alaasmagi.Base.Contracts.Domain
  • alaasmagi.Base.Domain
  • alaasmagi.Base.Contracts.DTO
  • alaasmagi.Base.DTO
  • alaasmagi.Base.Contracts.DataAccess
  • alaasmagi.Base.DataAccess.EF
  • alaasmagi.Base.Contracts.Application
  • alaasmagi.Base.Application
  • alaasmagi.Base.Contracts.Exception
  • alaasmagi.Base.Exception

Included Capabilities

These packages cover the common building blocks used across layered applications:

  • strongly typed base entity contracts
  • domain base classes with metadata, ownership, and soft delete support
  • mapper abstractions between layers
  • method-response and error models
  • generic repository contracts
  • generic EF Core repository implementations
  • unit-of-work abstractions
  • generic application service contracts and implementations
  • typed base exceptions and HTTP exceptions

Package Overview

alaasmagi.Base.Contracts.Domain

Defines contracts such as:

  • IBaseEntity<TKey>
  • IBaseEntityMeta
  • IBaseEntitySoftDelete
  • IBaseEntityUserId<TKey>
  • IBaseEntityWithMeta<TKey>
  • IBaseEntityWithMetaSoftDelete<TKey>

alaasmagi.Base.Domain

Provides reusable base entity types such as:

  • BaseEntity<TKey>
  • BaseEntityWithMeta<TKey>
  • BaseEntityWithMetaSoftDelete<TKey>
  • BaseEntityUser<TKey>
  • BaseEntityUserWithMeta<TKey, TUserKey>
  • BaseEntityUserWithMetaSoftDelete<TKey, TUserKey>

alaasmagi.Base.Contracts.DTO

Defines:

  • IMapper<TUpperEntity, TLowerEntity, TKey>
  • IMethodResponse<TValue>
  • IError<TCode>

alaasmagi.Base.DTO

Provides:

  • MethodResponse<TValue>
  • MethodResponse<TValue, TError>
  • Error
  • Error<TCode>
  • ErrorDefaults

alaasmagi.Base.Contracts.DataAccess

Defines:

  • IBaseRepository<TEntity, TResourceKey, TActor>
  • IBaseRepositorySoftDelete<TEntity, TResourceKey, TActor>
  • IBaseUow

alaasmagi.Base.DataAccess.EF

Provides EF Core implementations such as:

  • BaseRepository<TDomainEntity, TDataAccessEntity, TMapper, TResourceKey, TActor>
  • BaseRepositorySoftDelete<TDomainEntity, TDataAccessEntity, TMapper, TResourceKey, TActor>
  • BaseUow<TDbContext>

alaasmagi.Base.Contracts.Application

Defines:

  • IBaseService<TEntity, TKey, TActor>
  • IBaseServiceSoftDelete<TEntity, TKey, TActor>
  • IBaseServiceUow

alaasmagi.Base.Application

Provides:

  • BaseService<TEntity, TDomainEntity, TRepository, TKey, TActor>
  • BaseServiceSoftDelete<TEntity, TDomainEntity, TRepository, TKey, TActor>
  • BaseServiceUow<TUow>

alaasmagi.Base.Contracts.Exception

Defines:

  • IBaseException<TCode>
  • IHttpException<TCode>

alaasmagi.Base.Exception

Provides:

  • BaseException
  • BaseException<TCode>
  • HttpException
  • HttpException<TCode>

Typical Usage

A common setup looks like this:

  1. Inherit from a Base.Domain entity type that matches your needs.
  2. Implement an IMapper between your domain model and EF model if those types differ.
  3. Inherit from BaseRepository<...> or BaseRepositorySoftDelete<...>.
  4. If your application layer uses different models, implement another mapper between application and domain models.
  5. Inherit from BaseService<...> or BaseServiceSoftDelete<...>.

Example

using Base.Contracts.DTO;
using Base.DataAccess.EF;
using Base.Domain;
using Microsoft.EntityFrameworkCore;

public class Todo : BaseEntityWithMetaSoftDelete<Guid>
{
    public string Title { get; set; } = default!;
}

public class TodoDbEntity : BaseEntityWithMetaSoftDelete<Guid>
{
    public string Title { get; set; } = default!;
}

public class TodoMapper : IMapper<Todo, TodoDbEntity, Guid>
{
    public Todo? Map(TodoDbEntity? entity) => entity == null
        ? null
        : new Todo
        {
            Id = entity.Id,
            Title = entity.Title,
            CreatedAt = entity.CreatedAt,
            CreatedBy = entity.CreatedBy,
            UpdatedAt = entity.UpdatedAt,
            UpdatedBy = entity.UpdatedBy,
            IsDeleted = entity.IsDeleted
        };

    public IEnumerable<Todo>? Map(IEnumerable<TodoDbEntity>? entities) =>
        entities?.Select(Map)!;

    public TodoDbEntity? Map(Todo? entity) => entity == null
        ? null
        : new TodoDbEntity
        {
            Id = entity.Id,
            Title = entity.Title,
            CreatedAt = entity.CreatedAt,
            CreatedBy = entity.CreatedBy,
            UpdatedAt = entity.UpdatedAt,
            UpdatedBy = entity.UpdatedBy,
            IsDeleted = entity.IsDeleted
        };

    public IEnumerable<TodoDbEntity>? Map(IEnumerable<Todo>? entities) =>
        entities?.Select(Map)!;
}

public class TodoRepository
    : BaseRepositorySoftDelete<Todo, TodoDbEntity, TodoMapper, Guid, Guid>
{
    public TodoRepository(DbContext dbContext, TodoMapper mapper)
        : base(dbContext, mapper)
    {
    }
}

Framework and Dependencies

All packages in this repository currently target:

  • .NET 10.0

Relevant package dependencies used across the set include:

  • Microsoft.EntityFrameworkCore
  • Microsoft.Extensions.Caching.StackExchangeRedis
  • Sentry
  • Sentry.AspNetCore

Notes

  • These packages are designed to be used together, but each package can also be consumed independently where appropriate.
  • Keep package versions in sync across the alaasmagi.Base.* set.
  • Base.DataAccess.EF is intended for EF Core based persistence.
  • Repository and service methods return IMethodResponse<T> so calling code can handle success and failure consistently.
  • Metadata timestamps and actor fields are populated automatically by the EF repository base classes when supported by the entity type.
  • User-based scoping is applied automatically when the entity implements IBaseEntityUserId<TActor> and a non-default actor value is supplied.
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

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
1.1.2 88 6/1/2026
1.1.1 97 5/24/2026
1.1.0 101 4/1/2026
1.0.11 105 3/29/2026
1.0.10 103 3/20/2026
1.0.9 97 3/20/2026
1.0.8 97 3/20/2026
1.0.7 98 3/19/2026
1.0.6 92 3/19/2026
1.0.5 93 3/19/2026
1.0.4 98 3/18/2026
1.0.3 94 3/18/2026
1.0.2 116 3/17/2026
1.0.1 96 3/17/2026
1.0.0 106 3/16/2026