Пример #1
0
 public static WholesalerDto MapToDto(Wholesaler wholesaler)
 {
     return(new WholesalerDto
     {
         Id = wholesaler.Id,
         WholesalerInfo = WholesalerInfoMapper.MapToDto(wholesaler.WholesalerInfo),
         Products = wholesaler.Products == null ? null : ProductMapper.MapToDto(wholesaler.Products),
         CreatedDateTime = wholesaler.CreatedDateTime,
         ModifiedDateTime = wholesaler.ModifiedDateTime
     });
 }
Пример #2
0
        public static ShelfProductDto MapToDto(ShelfProduct shelfProduct)
        {
            if (shelfProduct == null)
            {
                return(null);
            }

            return(new ShelfProductDto
            {
                Id = shelfProduct.Id,
                ProductId = shelfProduct.ProductId,
                Row = shelfProduct.Row,
                Column = shelfProduct.Column,
                Product = ProductMapper.MapToDto(shelfProduct.Product)
            });
        }