Skip to content

Problem with multiple mappers #278

Answered by alirezanet
sh-sharifjonov asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @sh-sharifjonov,
I think you have to do it manually, the trick is to give your admin mapper its own interface so your AdminController can only ever see that one. For example:

// 1) Marker interface
public interface IAdminProductApplicationsMapper 
    : IGridifyMapper<ProductApplication> {}

// 2) Mapper implementation
public class GetAdminProductApplicationsGridifyMapper 
    : GridifyMapper<ProductApplication>, IAdminProductApplicationsMapper
{
    public GetAdminProductApplicationsGridifyMapper(IAdminAuthenticatedService svc)
    {
        AddMap("Id",                  o => o.Id);
        AddMap("ProductName",         o => o.Product!.Name);
        AddMap("ProductApplicationType", o 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sh-sharifjonov
Comment options

Answer selected by sh-sharifjonov
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