예제 #1
0
 // bll dto to itemsView dto
 public v2.Item MapToItemDisplay(BLL.App.DTO.Item outObject)
 {
     return(new v2.Item()
     {
         Id = outObject.Id,
         Description = outObject.Description,
         UserId = outObject.UserId,
         Price = outObject.Price,
         BrandId = outObject.BrandId,
         Discount = outObject.Discount,
         Name = outObject.Name,
         Brand = outObject.Brand == null ? null : BrandMapper.Map(outObject.Brand),
         Categories = outObject.ItemCategories.Select(ic => CategoryMapper.Map(ic.Category !))
     });
예제 #2
0
 //  bll dto to public api dto
 public v2.Item Map(BLL.App.DTO.Item outObject)
 {
     return(new v2.Item()
     {
         Id = outObject.Id,
         Description = outObject.Description,
         UserId = outObject.UserId,
         Price = outObject.Price,
         BrandId = outObject.BrandId,
         Discount = outObject.Discount,
         Name = outObject.Name,
         Brand = outObject.Brand == null ? null : BrandMapper.Map(outObject.Brand),
         Categories = null
     });
 }
예제 #3
0
 public ItemMapper()
 {
     CategoryMapper = new CategoryMapper();
     BrandMapper    = new BrandMapper();
 }
예제 #4
0
 public WarehouseMapper()
 {
     CategoryMapper = new CategoryMapper();
     BrandMapper    = new BrandMapper();
     ItemMapper     = new ItemMapper();
 }