I using automapper (last version).
I want to if a product create by logged in seller, a property will be changed in the select.
public class AutoMapperProfile : Profile
{
public AutoMapperProfile()
{
CreateMap<Product, ProductDto>();
}
}
var sellerId = 10; // Get from database
var products = _products
.Select(x => new ProductDto
{
CanEdit = x.SellerId == sellerId ? true : false
});
How can write above select by using automapper ?
Thanks a lot.