abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.76k stars 3.41k forks source link

ExtraProperties ignored in AutoMapper's ProjectTo<> #20217

Open antonGritsenko opened 2 months ago

antonGritsenko commented 2 months ago

Is there an existing issue for this?

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> 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 commented 2 months ago

hi

Can you upload a simple project to GitHub? Thanks.