dto and automapper
public TeamDTO GetByID(int id)
{
var team = ... //Get Team entity from data store
return Mapper.Map<TeamDTO>(team);
}
dto and automapper
public TeamDTO GetByID(int id)
{
var team = ... //Get Team entity from data store
return Mapper.Map<TeamDTO>(team);
}
c# mapper.map
var config = new MapperConfiguration(cfg => { cfg.CreateMap<AuthorModel, AuthorDTO>(); });IMapper iMapper = config.CreateMapper();var source = new AuthorModel();source.Id = 1;source.FirstName = "Joydip";source.LastName = "Kanjilal";source.Address = "India";var destination = iMapper.Map<AuthorModel, AuthorDTO>(source);Console.WriteLine("Author Name: "+ destination.FirstName + " " + destination.LastName);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us