Skip to content

Error new Table #408

Answered by jeremiedevos
gustadelante asked this question in Q&A
Feb 11, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Have you created a mapping profile? This is needed for automapper to know how to map it.
If not navigate to Core/Application/Mappings and add a new class.
For example:

public class PriceProfile : Profile
{
    public PriceProfile()
    {
        CreateMap<AddEditPriceCommand, Price>().ReverseMap();
        CreateMap<GetPriceByIdResponse, Price>().ReverseMap();
        CreateMap<GetAllPricesResponse, Price>().ReverseMap();
    }
}

Not the inheritance from Profile, when the app is started, all the classes with this inheritance will be setup as a automapper profile.
Hope this helped!

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@gustadelante
Comment options

Answer selected by gustadelante
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants