Skip to content

Instantly share code, notes, and snippets.

@Guifgr
Last active July 6, 2023 13:24
Show Gist options
  • Save Guifgr/f37f0b8b9b3e6c22808689927736cfb4 to your computer and use it in GitHub Desktop.
Save Guifgr/f37f0b8b9b3e6c22808689927736cfb4 to your computer and use it in GitHub Desktop.
automapper
private readonly IMapper _mapper;
public Class(IMapper mapper)
{
_mapper = mapper;
}
namespace project.Profiles
{
public class ModelProfile : Profile
{
public ModelProfile()
{
//Source -> Target
CreateMap<Model, ModelDto>().ReverseMap();
}
}
}
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment