public List<Product> GetProducts() { List<Product> Result = null; using (var Context = new NORTHWNDEntities()) { Result = Context.Products.ToList(); } return Result; }
public Product GetProductByID(int ID) { var Context = new NORTHWNDEntities(); return Context.Products.FirstOrDefault(p => p.ProductID == ID); }