Exemplo n.º 1
0
        // 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);
                }
            }
        }
Exemplo n.º 2
0
        // 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;
            //}
        }