//public static PRICE price; public static PRODUCTS_DTO getProductsById(int id) { using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities()) { return(ProductsCRUD.ReadById(ctx, id)); } }
public static PRICE GetProductPrice(PRODUCTS_TBL product) { using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities()) { var productdetail = ProductsCRUD.ReadById(ctx, product.productId); if (productdetail != null) { PRICE price = ctx.PRICEs.Where(u => u.productId == product.productId).FirstOrDefault(); return(price); } return(null); } }