public static bool RoleExists(string name) { CTSContext entities = new CTSContext(); var count = entities.Roles.Where(p => p.Name == name).Count(); return (count > 0); }