problem I have a dto and a main class with id and I made another dto without id. I don't want the id to be displayed on swagger
Service Layer
public async Task<SuperHeroDto> Create(SuperHeroDto dto) // class with id
{
var model = _mapper.Map<SuperHero>(dto); //Main class with id
_demoAPIDbContext.SuperHeroes.Add(model);
var saveChange = await _demoAPIDbContext.SaveChangesAsync();
return _mapper.Map(model, dto);
}
Question, how can I map the class that has no id?
The attributes of the 3 classes are all the same, only one has no id
public class CreateSuperHeroDTO
{
public string Name { get; set; }
public string FirtstName { get; set; }
public string LastName { get; set; }
public string Place { get; set; }
}