public User_Product GetProdctDetail(int productId) { try { User_Product product = productRepository.GetProductDetail(productId); if (product != null) { product.Colors = productColorRepository.GetProductColor(product.ProductId); product.Sizes = productSizeRepository.GetProductSize(product.ProductId); product.Images = imageRepository.GetImageOfProduct(product.ProductId); } return(product); } catch (Exception ex) { //ex.LogExceptionToFile(); throw new Exception(ex.Message); } }