示例#1
0
        public List <projekt> GetProjects()
        {
            List <projekt> projects = new List <projekt>();

            using (var context = new firmaEntities())
            {
                projects.AddRange(context.projekt.ToList());
            }
            return(projects);
        }
示例#2
0
        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);
        }