![]() |
VOOZH | about |
dotnet add package eQuantic.Core.Application.Crud --version 1.9.1
NuGet\Install-Package eQuantic.Core.Application.Crud -Version 1.9.1
<PackageReference Include="eQuantic.Core.Application.Crud" Version="1.9.1" />
<PackageVersion Include="eQuantic.Core.Application.Crud" Version="1.9.1" />Directory.Packages.props
<PackageReference Include="eQuantic.Core.Application.Crud" />Project file
paket add eQuantic.Core.Application.Crud --version 1.9.1
#r "nuget: eQuantic.Core.Application.Crud, 1.9.1"
#:package eQuantic.Core.Application.Crud@1.9.1
#addin nuget:?package=eQuantic.Core.Application.Crud&version=1.9.1Install as a Cake Addin
#tool nuget:?package=eQuantic.Core.Application.Crud&version=1.9.1Install as a Cake Tool
The eQuantic Core API CRUD provides all the implementation needed to publish CRUD APIs.
To install eQuantic.Core.Api.Crud, run the following command in the Package Manager Console
Install-Package eQuantic.Core.Api.Crud
[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;
}
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;
}
public class OrderRequest
{
public DateTime? Date { get; set; }
}
public class OrderItemRequest
{
public string? Name { get; set; }
}
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;
}
}
public interface IOrderService : ICrudService<Order, OrderRequest>
{
}
[MapCrudEndpoints]
public class OrderService : CrudServiceBase<Order, OrderRequest, OrderData, UserData>, IOrderService
{
public OrderService(IQueryableUnitOfWork unitOfWork, IMapperFactory mapperFactory) : base(unitOfWork, mapperFactory)
{
}
}
Program.csvar 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.MapCrud<Order, OrderRequest, IOrderService>();
app.Run();
or
...
app.MapAllCrud(opt => opt.FromAssembly(assembly));
app.Run();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on eQuantic.Core.Application.Crud:
| Package | Downloads |
|---|---|
|
eQuantic.Core.Api.Crud
eQuantic API CRUD Library |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.9.1 | 301 | 7/6/2025 |
| 1.9.0 | 311 | 6/22/2025 |
| 1.8.3 | 283 | 6/17/2025 |
| 1.8.2 | 446 | 6/11/2025 |
| 1.8.1 | 395 | 6/11/2025 |
| 1.8.0 | 213 | 5/30/2025 |
| 1.7.35 | 286 | 5/29/2025 |
| 1.7.34 | 272 | 5/10/2025 |
| 1.7.33 | 201 | 5/10/2025 |
| 1.7.32 | 238 | 4/19/2025 |
| 1.7.31 | 240 | 4/19/2025 |
| 1.7.30 | 264 | 2/27/2025 |
| 1.7.29 | 268 | 2/23/2025 |
| 1.7.28 | 298 | 2/18/2025 |
| 1.7.27 | 368 | 1/21/2025 |
| 1.7.26 | 466 | 1/10/2025 |
| 1.7.25 | 242 | 1/8/2025 |
| 1.7.24 | 301 | 12/27/2024 |
| 1.7.23 | 350 | 12/26/2024 |
| 1.7.22 | 229 | 12/26/2024 |
Generic CRUD endpoints for Entities