public static ItemDto Map(ItemViewModel view) { if (view == null) { return(null); } return(new ItemDto { Id = view.Id, Name = view.Name, Price = view.Price, Active = view.Active, RowVision = view.RowVision, Discounts = ItemDiscountTypeMapper.Map(view.Discount) }); }
public static ItemViewModel Map(ItemDto dto) { if (dto == null) { return(null); } return(new ItemViewModel { Id = dto.Id, Name = dto.Name, Price = dto.Price, Active = dto.Active, RowVision = dto.RowVision, Discount = ItemDiscountTypeMapper.Map(dto.Discounts) }); }