Код: Выделить всё
public class ActionDTO
{
public int Id { get; set; }
public required string Name { get; set; }
}
Код: Выделить всё
public class MappingProfiles : Profile
{
public MappingProfiles() {
CreateMap();
CreateMap();
}
}
Код: Выделить всё
[HttpGet]
public async Task GetActions()
{
if (planProDbContext.Actions == null)
{
return NotFound();
}
IEnumerable actions = await planProDbContext.Actions.ToListAsync();
// List actionDTOs = mapper.Map(actions);
return Ok(actions);
}
Подробнее здесь: https://stackoverflow.com/questions/785 ... st-of-dtos