public static Buyer FromRepoBuyerToBuyer(this RepoBuyer item) { Mapper.Initialize(cfg => cfg.CreateMap <RepoBuyer, Buyer>() .ForMember(x => x.BuyCars, _ => _.Ignore()) .ForMember(x => x.Cars, x => x.Ignore())); return(Mapper.Map <RepoBuyer, Buyer>(item)); }
public static DomainBuyer FromRepoBuyerToDomainBuyer(this RepoBuyer item) { if (item == null) { return(null); } return(new DomainBuyer { Id = item.Id, Email = item.Email, }); }