Refactored Program.cs
This commit is contained in:
@@ -30,7 +30,8 @@ public class CreatePurchaseProductEndpoint(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.FirstOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.PurchaseOrderId), ct);
|
PurchaseOrder? purchaseOrder =
|
||||||
|
await purchaseOrdersRepository.FirstOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.PurchaseOrderId), ct);
|
||||||
|
|
||||||
if (purchaseOrder == null)
|
if (purchaseOrder == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using FastEndpoints;
|
|||||||
using FastEndpoints.Swagger;
|
using FastEndpoints.Swagger;
|
||||||
using FastEndpoints.Security;
|
using FastEndpoints.Security;
|
||||||
using PyroFetes.MappingProfiles;
|
using PyroFetes.MappingProfiles;
|
||||||
using IMapper = FastEndpoints.IMapper;
|
using PyroFetes.Repositories;
|
||||||
|
|
||||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
@@ -19,6 +19,17 @@ builder.Services
|
|||||||
// On ajoute ici la configuration de la base de données
|
// On ajoute ici la configuration de la base de données
|
||||||
builder.Services.AddDbContext<PyroFetesDbContext>();
|
builder.Services.AddDbContext<PyroFetesDbContext>();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<DeliverersRepository>();
|
||||||
|
builder.Services.AddScoped<DeliveryNotesRepository>();
|
||||||
|
builder.Services.AddScoped<PricesRepository>();
|
||||||
|
builder.Services.AddScoped<ProductDeliveriesRepository>();
|
||||||
|
builder.Services.AddScoped<ProductsRepository>();
|
||||||
|
builder.Services.AddScoped<PurchaseOrdersRepository>();
|
||||||
|
builder.Services.AddScoped<PurchaseProductsRepository>();
|
||||||
|
builder.Services.AddScoped<QuotationProductsRepository>();
|
||||||
|
builder.Services.AddScoped<QuotationsRepository>();
|
||||||
|
builder.Services.AddScoped<SuppliersRepository>();
|
||||||
|
builder.Services.AddScoped<SettingsRepository>();
|
||||||
|
|
||||||
MapperConfiguration mappingConfig = new(mc =>
|
MapperConfiguration mappingConfig = new(mc =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user