eQuantic.Core.DataModel
3.0.0
See the version list below for details.
dotnet add package eQuantic.Core.DataModel --version 3.0.0
NuGet\Install-Package eQuantic.Core.DataModel -Version 3.0.0
<PackageReference Include="eQuantic.Core.DataModel" Version="3.0.0" />
<PackageVersion Include="eQuantic.Core.DataModel" Version="3.0.0" />
<PackageReference Include="eQuantic.Core.DataModel" />
paket add eQuantic.Core.DataModel --version 3.0.0
#r "nuget: eQuantic.Core.DataModel, 3.0.0"
#:package eQuantic.Core.DataModel@3.0.0
#addin nuget:?package=eQuantic.Core.DataModel&version=3.0.0
#tool nuget:?package=eQuantic.Core.DataModel&version=3.0.0
eQuantic.Core.Api Library
The eQuantic Core API provides all the implementation needed to publish standard APIs.
What's new in v2.0
- .NET 8 & .NET 10 (net6/net9 dropped — end of life).
- eQuantic.Linq v3:
PagedListRequest<TEntity>now bindsfilterBy/orderByinto typed, serializable collections (FilteringCollection<TEntity>/SortingCollection<TEntity>) using the v3 query syntax; Swagger documents the filter grammar and the entity's real member paths automatically (eQuantic.Linq.Web.Swashbuckle). TheeQuantic.Core.Mvcbinders are no longer needed. IWithReferenceId<TDataEntity, TKey>.GetReferenceFilter()now returns a plainExpression<Func<TDataEntity, bool>>(provider-agnostic) instead of the v2IFiltering.- Automated releases with semantic-release (see docs/releasing.md).
To install eQuantic.Core.Api, run the following command in the Package Manager Console
Install-Package eQuantic.Core.Api
Example of implementation
The data entities
[Table("orders")]
public class OrderData : EntityDataBase
{
[Key]
public string Id { get; set; } = string.Empty;
public DateTime Date { get; set; }
public virtual ICollection<OrderItemData> Items { get; set; } = new HashSet<OrderItemData>();
}
[Table("orderItems")]
public class OrderItemData : EntityDataBase, IWithReferenceId<OrderItemData, int>
{
[Key]
public int Id { get; set; }
public int OrderId { get; set; }
[ForeignKey(nameof(OrderId))]
public virtual OrderData? Order { get; set; }
[Required]
[MaxLength(200)]
public string Name { get; set; } = string.Empty;
}
The models
public class Order
{
public string Id { get; set; } = string.Empty;
public DateTime Date { get; set; }
}
public class OrderItem
{
public int Id { get; set; }
public int OrderId { get; set; }
public string Name { get; set; } = string.Empty;
}
The request models
public class OrderRequest
{
public DateTime? Date { get; set; }
}
public class OrderItemRequest
{
public string? Name { get; set; }
}
The mappers
public class OrderMapper : IMapper<OrderData, Order>, IMapper<OrderRequest, OrderData>
{
public Order? Map(OrderData? source)
{
return Map(source, new Order());
}
public Order? Map(OrderData? source, Order? destination)
{
if (source == null)
{
return null;
}
if (destination == null)
{
return Map(source);
}
destination.Id = source.Id;
destination.Date = source.Date;
return destination;
}
public OrderData? Map(OrderRequest? source)
{
return Map(source, new OrderData());
}
public OrderData? Map(OrderRequest? source, OrderData? destination)
{
if (source == null)
{
return null;
}
if (destination == null)
{
return Map(source);
}
destination.Date = source.Date ?? DateTime.UtcNow;
return destination;
}
}
The services
public interface IOrderService : IApplicationService
{
}
[MapCrudEndpoints]
public class OrderService : IOrderService
{
private readonly IMapperFactory _mapperFactory;
private readonly ILogger<ExampleService> _logger;
private readonly IAsyncQueryableRepository<IQueryableUnitOfWork, OrderData, int> _repository;
public OrderService(
IApplicationContext<int> applicationContext,
IQueryableUnitOfWork unitOfWork,
IMapperFactory mapperFactory,
ILogger<OrderService> logger)
{
_mapperFactory = mapperFactory;
_logger = logger;
_repository = unitOfWork.GetAsyncQueryableRepository<IQueryableUnitOfWork, OrderData, int>();
}
public async Task<Order?> GetByIdAsync(int orderId, CancellationToken cancellationToken = default)
{
var item = await _repository.GetAsync(orderId, cancellationToken: cancellationToken);
if (item == null)
{
var ex = new EntityNotFoundException<int>(orderId);
_logger.LogError(ex, "{ServiceName} - GetById: Entity of {EntityName} not found", GetType().Name,
nameof(OrderData));
throw ex;
}
var mapper = _mapperFactory.GetMapper<OrderData, Order>()!;
var result = mapper.Map(item);
return result;
}
}
The Program.cs
var builder = WebApplication.CreateBuilder(args);
var assembly = typeof(Program).Assembly;
builder.Services.AddDbContext<ExampleDbContext>(opt =>
opt.UseInMemoryDatabase("ExampleDb"));
builder.Services.AddQueryableRepositories<ExampleUnitOfWork>(opt =>
{
opt.FromAssembly(assembly)
.AddLifetime(ServiceLifetime.Scoped);
});
builder.Services
.AddMappers(opt => opt.FromAssembly(assembly))
.AddTransient<IExampleService, ExampleService>()
.AddControllers()
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
})
.AddFilterModelBinder()
.AddSortModelBinder();
builder.Services
.AddEndpointsApiExplorer()
.AddApiDocumentation(opt => opt.WithTitle("Example API"));
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseApiDocumentation();
}
app.UseHttpsRedirection();
app.UseRouting();
app.MapControllers();
app.MapGet("orders/{id}", GetById);
app.Run();
return;
async Task<Results<Ok<Order>, NotFound>> GetById(
[FromRoute] int id,
[FromServices] IOrderService service,
CancellationToken cancellationToken)
{
var item = await service.GetByIdAsync(id, cancellationToken);
if (item == null)
return TypedResults.NotFound();
return TypedResults.Ok(item);
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- eQuantic.Core.Data (>= 5.5.0)
- eQuantic.Core.Domain (>= 3.0.0)
-
net8.0
- eQuantic.Core.Data (>= 5.5.0)
- eQuantic.Core.Domain (>= 3.0.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on eQuantic.Core.DataModel:
| Package | Downloads |
|---|---|
|
eQuantic.Core.Data
eQuantic Core Data Class Library |
|
|
eQuantic.Core.Application.Crud
eQuantic Application CRUD Library |
|
|
eQuantic.Core.Persistence
eQuantic Persistence Library |
|
|
eQuantic.Core.Data.Abstractions
The contract surface of eQuantic.Core.Data: repository, unit-of-work and set interfaces, the query and update models, the modeling attributes, migration operations and the model snapshot. Reference this from a domain or application layer to express persistence without depending on the engine or on any store. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.9.0 | 0 | 7/27/2026 |
| 6.8.0 | 44 | 7/26/2026 |
| 6.7.0 | 61 | 7/26/2026 |
| 6.6.0 | 44 | 7/26/2026 |
| 6.5.0 | 57 | 7/24/2026 |
| 4.0.0 | 633 | 7/22/2026 |
| 3.0.0 | 252 | 7/21/2026 |
| 2.1.0 | 196 | 7/18/2026 |
| 2.0.0 | 208 | 7/18/2026 |
| 1.9.3 | 284 | 3/2/2026 |
| 1.9.2 | 957 | 6/22/2025 |
| 1.9.1 | 417 | 6/22/2025 |
| 1.9.0 | 334 | 6/22/2025 |
| 1.8.2 | 294 | 6/21/2025 |
| 1.8.1 | 412 | 6/17/2025 |
| 1.8.0 | 386 | 5/30/2025 |
Generic data models for applications