Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtraProperties ignored in AutoMapper's ProjectTo<> #20217

Open
1 task done
antonGritsenko opened this issue Jul 12, 2024 · 1 comment
Open
1 task done

ExtraProperties ignored in AutoMapper's ProjectTo<> #20217

antonGritsenko opened this issue Jul 12, 2024 · 1 comment
Labels

Comments

@antonGritsenko
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description

ExtraProperties ignored if ProjectTo<> method of AutoMapper was used.

Reproduction Steps

  1. Add any extra property to IdentityUser
  2. Rune pseudo code:
public UsersController(IReadOnlyRepository<IdentityUser> repo, IMapper mapper)
{
    
}

public async Task<IQueryable<IdentityUserDto>> Get()
{
    var queryCustom = (await _dataSet.GetDbSetAsync()).Where(t => t.Surname == "Dow");
    var resultNotMapped = queryCustom.ToList(); //here we have ExtraProperty set
    
    var mappedQuery = _mapper.ProjectTo<IdentityUserDto>(queryCustom); 
    var resultMapped = mapperQuery.ToList(); // ExtraProperty always is 0 list

    return mappedQuery;
}

Expected behavior

ProjectTo correctly handling ExtraProperties

Actual behavior

ProjectTo not handling ExtraProperties

Regression?

No response

Known Workarounds

No response

Version

8.1.1

User Interface

Angular

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

@maliming
Copy link
Member

hi

Can you upload a simple project to GitHub?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants