c# - CS0161: 'ProductModel.GetProducts(int)': not all code paths return a value -
i getting compilation error in next code, please help:
private product getproduct(int id) { seek { using (coffeedbentities db = new coffeedbentities()) { product product = db.products.find(id); } } catch(exception) { homecoming null; } }
you should homecoming product
private product getproduct(int id) { product product =new product(); seek { using (coffeedbentities db = new coffeedbentities()) { product = db.products.find(id); } } catch(exception) { homecoming null; } homecoming product; }
c# asp.net-mvc
No comments:
Post a Comment