Try to map everything beforehand, bad decision, checkpoint

This commit is contained in:
lumijiez
2025-05-04 01:22:10 +03:00
parent 65f25318a5
commit 8f565ff0af
10 changed files with 306 additions and 1 deletions

View File

@@ -11,6 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Printbase.Application\Printbase.Application.csproj" />
<ProjectReference Include="..\Printbase.Infrastructure\Printbase.Infrastructure.csproj" />
</ItemGroup>

View File

@@ -1,4 +1,7 @@
using System.Reflection;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Printbase.Application.Common.Behaviors;
using Printbase.Domain.Repositories;
using Printbase.Infrastructure.Database;
using Printbase.Infrastructure.Mapping;
@@ -15,6 +18,10 @@ services.AddDbContext<ApplicationDbContext>(options =>
b => b.MigrationsAssembly(typeof(ApplicationDbContext).Assembly.FullName)));
services.AddAutoMapper(typeof(ProductMappingProfile).Assembly);
services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
services.AddScoped<IProductRepository, ProductRepository>();
services.AddScoped<IProductVariantRepository, ProductVariantRepository>();
services.AddScoped<IProductTypeRepository, ProductTypeRepository>();