示例#1
0
 public static ItemDto Map(Item model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new ItemDto
     {
         Id = model.Id,
         Name = model.Name,
         Price = model.Price,
         Active = model.Active,
         Discounts = ItemDiscountTypeMapper.Map(model.Discount),
         RowVision = model.RowVersion
     });
 }
示例#2
0
        public static Item Map(ItemDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            return(new Item
            {
                Id = dto.Id,
                Name = dto.Name,
                Price = dto.Price,
                Active = dto.Active,
                Discount = ItemDiscountTypeMapper.Map(dto.Discounts),
                RowVersion = dto.RowVision
            });
        }