Ejemplo n.º 1
0
        public static SelectList getSelectList()
        {
            var db    = new _GabsDbContext();
            var items = db.Projects.Where(x => x.IsActive != false).Select(i => new SelectListItem()
            {
                Text  = i.Name,
                Value = i.Id.ToString()
            });

            var selectList = new SelectList(items, "Value", "Text");

            return(selectList);
        }
Ejemplo n.º 2
0
        public static string getProjectNameById(int Id)
        {
            var db = new _GabsDbContext();

            return(db.Projects.Find(Id).Name);
        }