Exemplo n.º 1
0
        public IEnumerable <CarModelView> GetCarModelsWUsers()
        {
            var list = new List <CarModelView>();

            using (_ctx = new GuildCarsEntities())
            {
                var carModels = _ctx.GetCarModel();

                foreach (var model in carModels)
                {
                    list.Add(ModelView.Model(model));
                }
            }
            return(list);
        }
Exemplo n.º 2
0
        public List <GetCarModel> GetCarModel()
        {
            List <GetCarModel> list = new List <GetCarModel>();

            using (_ctx = new GuildCarsEntities())
            {
                var carModels = _ctx.GetCarModel();

                foreach (var model in carModels)
                {
                    GetCarModel c = new GetCarModel();

                    c.CarModelId = model.CarModelId;
                    c.CarMakeId  = model.CarMakeId;
                    c.DateAdded  = model.DateAdded;
                    c.ModelName  = model.ModelName;

                    list.Add(c);
                }
            }
            return(list);
        }