Fixed map profile, added migration for services
This commit is contained in:
@ -7,7 +7,10 @@ namespace Birdmap.API.MapperProfiles
|
||||
{
|
||||
public BirdmapProfile()
|
||||
{
|
||||
CreateMap<User, DTOs.AuthenticateResponse>().ReverseMap();
|
||||
CreateMap<User, DTOs.AuthenticateResponse>()
|
||||
.ForMember(m => m.Username, opt => opt.MapFrom(m => m.Name))
|
||||
.ForMember(m => m.UserRole, opt => opt.MapFrom(m => m.Role))
|
||||
.ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,8 @@ namespace Birdmap
|
||||
services.AddControllersWithViews()
|
||||
.AddJsonOptions(opt =>
|
||||
{
|
||||
opt.JsonSerializerOptions.Converters.Add(new System.Text.Json.Serialization.JsonStringEnumConverter());
|
||||
opt.JsonSerializerOptions.IgnoreNullValues = true;
|
||||
//opt.JsonSerializerOptions.PropertyNamingPolicy = new JsonNamingPolicy()
|
||||
});
|
||||
|
||||
@ -87,7 +89,7 @@ namespace Birdmap
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapHealthChecks("/health").RequireAuthorization();
|
||||
endpoints.MapHealthChecks("/health");
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user