public static DAL.App.DTO.DomainLikeDTO.Inventory MapFromDomain(Domain.Inventory inventory) { var res = inventory == null ? null : new DAL.App.DTO.DomainLikeDTO.Inventory { Id = inventory.Id, Description = inventory.Description?.Translate(), InventoryCreationTime = inventory.InventoryCreationTime, ShopId = inventory.ShopId, Shop = ShopMapper.MapFromDomain(inventory.Shop) }; return(res); }
public static DAL.App.DTO.DomainLikeDTO.Identity.AppUser MapFromDomain(Domain.Identity.AppUser appUser) { var res = appUser == null ? null : new DAL.App.DTO.DomainLikeDTO.Identity.AppUser { Id = appUser.Id, FirstName = appUser.FirstName, LastName = appUser.LastName, Email = appUser.Email, Aadress = appUser.Aadress, ShopId = appUser.ShopId, Shop = ShopMapper.MapFromDomain(appUser.Shop) }; return(res); }
public static DAL.App.DTO.DomainLikeDTO.Comment MapFromDomain(Domain.Comment comment) { var res = comment == null ? null : new DAL.App.DTO.DomainLikeDTO.Comment { Id = comment.Id, CommentTitle = comment.CommentTitle.Translate(), CommentBody = comment.CommentBody.Translate(), ProductId = comment.ProductId, Product = ProductMapper.MapFromDomain(comment.Product), ShopId = comment.ShopId, Shop = ShopMapper.MapFromDomain(comment.Shop) }; return(res); }
public static DAL.App.DTO.DomainLikeDTO.Return MapFromDomain(Domain.Return @return) { var res = @return == null ? null : new DAL.App.DTO.DomainLikeDTO.Return { Id = @return.Id, Description = @return.Description.Translate(), ShopId = @return.ShopId, Shop = ShopMapper.MapFromDomain(@return.Shop) }; if (@return?.ProductsReturned != null) { res.ProductsReturned = @return.ProductsReturned.Select(e => ProductReturnedMapper.MapFromDomain(e)).ToList(); } return(res); }
public static DAL.App.DTO.DomainLikeDTO.Category MapFromDomain(Domain.Category category) { var res = category == null ? null : new DAL.App.DTO.DomainLikeDTO.Category { Id = category.Id, CategoryName = category.CategoryName.Translate(), ShopId = category.ShopId, Shop = ShopMapper.MapFromDomain(category.Shop) }; if (category?.ProductsInCategory != null) { res.ProductsInCategory = category.ProductsInCategory.Select(e => ProductInCategoryMapper.MapFromDomain(e)).ToList(); } return(res); }
public static DAL.App.DTO.DomainLikeDTO.Defect MapFromDomain(Domain.Defect defect) { var res = defect == null ? null : new DAL.App.DTO.DomainLikeDTO.Defect { Id = defect.Id, Description = defect.Description.Translate(), ShopId = defect.ShopId, Shop = ShopMapper.MapFromDomain(defect.Shop) }; if (defect?.ProductsWithDefect != null) { res.ProductsWithDefect = defect.ProductsWithDefect.Select(e => ProductWithDefectMapper.MapFromDomain(e)).ToList(); } return(res); }
public static DAL.App.DTO.DomainLikeDTO.Order MapFromDomain(Domain.Order order) { var res = order == null ? null : new DAL.App.DTO.DomainLikeDTO.Order { Id = order.Id, Description = order.Description.Translate(), OrderCreationTime = order.OrderCreationTime, ShipperId = order.ShipperId, Shipper = ShipperMapper.MapFromDomain(order.Shipper), ShopId = order.ShopId, Shop = ShopMapper.MapFromDomain(order.Shop) }; if (order?.ProductsInOrder != null) { res.ProductsInOrder = order.ProductsInOrder.Select(e => ProductInOrderMapper.MapFromDomain(e)).ToList(); } return(res); }
public static DAL.App.DTO.DomainLikeDTO.Product MapFromDomain(Domain.Product product) { var res = product == null ? null : new DAL.App.DTO.DomainLikeDTO.Product { Id = product.Id, ManuFacturerItemCode = product.ManuFacturerItemCode?.Translate(), ShopCode = product.ShopCode?.Translate(), ProductName = product.ProductName?.Translate(), BuyPrice = product.BuyPrice, PercentageAddedToBuyPrice = product.PercentageAddedToBuyPrice, SellPrice = product.SellPrice, Quantity = product.Quantity, Weight = product.Weight?.Translate(), Length = product.Length?.Translate() }; if (product?.Manufacturer != null) { res.ManuFacturerId = product.ManuFacturerId; res.Manufacturer = ManuFacturerMapper.MapFromDomain(product.Manufacturer); res.InventoryId = product.InventoryId; res.Inventory = InventoryMapper.MapFromDomain(product.Inventory); res.ShopId = product.ShopId; res.Shop = ShopMapper.MapFromDomain(product.Shop); } if (product?.Comments != null) { res.Comments = product.Comments.Select(e => new DAL.App.DTO.DomainLikeDTO.Comment() { CommentTitle = e.CommentTitle.Translate(), CommentBody = e.CommentBody.Translate(), Id = e.Id }).ToList(); } return(res); }