end of tp2
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.EquivalencyExpression;
|
||||
using BookHive;
|
||||
using BookHive.MappingProfiles;
|
||||
using BookHive.Repositories;
|
||||
using FastEndpoints;
|
||||
using FastEndpoints.Security;
|
||||
@@ -38,16 +36,20 @@ builder.Services.AddScoped<LoanRepository>();
|
||||
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
|
||||
MapperConfiguration mappingConfig = new(mc =>
|
||||
builder.Services.AddAutoMapper(cfg =>
|
||||
{
|
||||
mc.AddCollectionMappers();
|
||||
mc.AddProfile(new DtoToEntityMappings());
|
||||
mc.AddProfile(new EntityToDtoMappings());
|
||||
}, new LoggerFactory());
|
||||
cfg.AddCollectionMappers();
|
||||
}, typeof(Program).Assembly);
|
||||
|
||||
// MapperConfiguration mappingConfig = new(mc =>
|
||||
// {
|
||||
// mc.AddCollectionMappers();
|
||||
// mc.AddProfile(new DtoToEntityMappings());
|
||||
// mc.AddProfile(new EntityToDtoMappings());
|
||||
// }, new LoggerFactory());
|
||||
|
||||
AutoMapper.IMapper mapper = mappingConfig.CreateMapper();
|
||||
builder.Services.AddSingleton(mapper);
|
||||
// AutoMapper.IMapper mapper = mappingConfig.CreateMapper();
|
||||
// builder.Services.AddSingleton(mapper);
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
app.UseAuthentication()
|
||||
|
||||
Reference in New Issue
Block a user