Took care of SonarCloud code issues (#1041)
This commit is contained in:
parent
5b32a958dc
commit
0e2fafe396
11 changed files with 27 additions and 69 deletions
|
@ -93,12 +93,9 @@ namespace API.Data
|
|||
await context.Database.EnsureCreatedAsync();
|
||||
|
||||
var users = await context.AppUser.ToListAsync();
|
||||
foreach (var user in users)
|
||||
foreach (var user in users.Where(user => string.IsNullOrEmpty(user.ApiKey)))
|
||||
{
|
||||
if (string.IsNullOrEmpty(user.ApiKey))
|
||||
{
|
||||
user.ApiKey = HashUtil.ApiKey();
|
||||
}
|
||||
user.ApiKey = HashUtil.ApiKey();
|
||||
}
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue