// GET api/<controller>/5 public Product Get(int id) { //connect using (VirtuosoModels db = new VirtuosoModels()) { db.Configuration.ProxyCreationEnabled = false; Product objP = (from p in db.Products where p.ProductID == id select p).FirstOrDefault(); return objP; } //return "value"; }
// GET api/<controller> public IEnumerable<Product> Get() { //connect using (VirtuosoModels db = new VirtuosoModels()) { //make sure json parsing works with the ef object db.Configuration.ProxyCreationEnabled = false; //query var objP = from p in db.Products orderby p.ProductID select p; return objP.ToList(); } //return new string[] { "value1", "value2" }; }