public partial class GoodAndProviderEntity
{
public int id { get; set; }
public int good_id { get; set; }
public int provider_id { get; set; }
public string Value { get; set; } <----- NEW
public virtual GoodEntity Goods { get; set; }
public virtual ProviderEntity Providers { get; set; }
}
public class GoodDTO
{
public int id { get; set; }
public string name { get; set; }
public string description { get; set; }
public decimal cost { get; set; }
public decimal? price { get; set; }
public string Value {get;set;} <--- NEW
public IList<ProviderDTO> providers { get; set; }
}
CreateMap<GoodEntity, GoodDTO>()
.ForMember(dto => dto.providers,
opt => opt.MapFrom(x => x.GoodsAndProviders.Select(y => y.Providers).ToList()))
.ForMember(dto => dto.Value, opt => opt.MapFrom(x => x.GoodsAndProviders.Select(s => s.Value)));
--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.