You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If merged type not equal with "ResultTypeDto" cause an error(not sure how to implement it mb via language specific things mb VS Code extension/VS extension)
Use case:
public class ProductWithSalesPersonDto: IProduct {
public SalesPerson: string;
}
...
var someProducts =
from products in _context.Product
from users in _context.Users
where products.IsPublished == true || products.UserId == userId
orderby products.UpdatedAt
select TypeMerger.TypeMerger<ProductWithSalesPersonDto>.Merge (products, new { users.SalesPerson });
The text was updated successfully, but these errors were encountered:
I may be reading this wrong but I think what you're asking is if the TypeMerger could return something other than an Anonymous Type. In this situation you'd like to use TypeMerger to merge the selected Product and the projection from the Users set.
If that is the case I would say you should look at AutoMapper. This opens up a big question of why should you use TypeMerger instead of just using AutoMapper using the CreateMissingTypeMaps property. My thoughts on this is because if you went that route you'd have to write more code in order to configure the mapping. With TypeMerger it's a zero configuration call to merge any two Anonymous Types.
Not sure if its possible in C# but what about
If merged type not equal with "ResultTypeDto" cause an error(not sure how to implement it mb via language specific things mb VS Code extension/VS extension)
Use case:
The text was updated successfully, but these errors were encountered: