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); }
public static string getProjectNameById(int Id) { var db = new _GabsDbContext(); return(db.Projects.Find(Id).Name); }