public List <projekt> GetProjects() { List <projekt> projects = new List <projekt>(); using (var context = new firmaEntities()) { projects.AddRange(context.projekt.ToList()); } return(projects); }
public bool IsAdminByUserName(string username) { bool isAdmin; using (var context = new firmaEntities()) { if (context.Users.Any(u => u.Roles.Any(r => r.RoleName == "Admin"))) { isAdmin = true; } else { isAdmin = false; } } return(isAdmin); }