// GET: api/Cars public IEnumerable <Model> Get() { { //return new string[] { "value1", "value2" }; using (var context = new ExperimentationDBEntities()) { var allModels = from model in context.Models select model; var models = allModels.ToList(); return(models); } } }
// GET: api/Cars public IEnumerable <Model> Index() { //return new string[] { "value1", "value2" }; using (var context = new ExperimentationDBEntities()) { var allModels = from model in context.Models select model; return(allModels); } ////return new string[] { "value1", "value2" }; //using (var context = new ServiceLibrary.DataContext.ExperimentationDBEntities()) //{ // var allModels = from model in context.Models // select model; // return allModels; //} }