Last active
July 6, 2023 13:24
-
-
Save Guifgr/f37f0b8b9b3e6c22808689927736cfb4 to your computer and use it in GitHub Desktop.
automapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly IMapper _mapper; | |
public Class(IMapper mapper) | |
{ | |
_mapper = mapper; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace project.Profiles | |
{ | |
public class ModelProfile : Profile | |
{ | |
public ModelProfile() | |
{ | |
//Source -> Target | |
CreateMap<Model, ModelDto>().ReverseMap(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment