public IEnumerable <ProfileViewModel> GetAllUsers() { using (IServiceScope scope = _provider.GetRequiredService <IServiceScopeFactory>().CreateScope()) { KlanikIdentityContext context = _provider.GetService <KlanikIdentityContext>(); return(context.Users.Select(x => new ProfileViewModel(x))); } }
public IEnumerable <string> GetAllRoles() { using (IServiceScope scope = _provider.GetRequiredService <IServiceScopeFactory>().CreateScope()) { KlanikIdentityContext context = _provider.GetService <KlanikIdentityContext>(); var result = context.Roles .Where(x => x.Name != "SuperUser") .Select(x => x.Name); return(result); } }