Add operation executor

This commit is contained in:
2025-10-25 20:30:49 +09:00
parent 59470b49d1
commit 891d462af1
19 changed files with 144 additions and 52 deletions

View File

@ -13,7 +13,7 @@ namespace Hcs.WebApp.Services
private readonly UserManager<AppUser> userManager = userManager;
private readonly IPasswordHasher<AppUser> passwordHasher = passwordHasher;
public async Task<IEnumerable<AppUserWithRole>> GetUsersWithRole()
public async Task<IEnumerable<AppUserWithRole>> GetUsersWithRoleAsync()
{
using var context = factory.CreateDbContext();
return await (from user in context.Users
@ -26,7 +26,7 @@ namespace Hcs.WebApp.Services
}).ToListAsync();
}
public async Task<IdentityResult> CreateUser(string userName, string roleName, string password)
public async Task<IdentityResult> CreateUserAsync(string userName, string roleName, string password)
{
var user = new AppUser()
{
@ -41,7 +41,7 @@ namespace Hcs.WebApp.Services
return result;
}
public async Task UpdateUser(string userId, string roleId, string password)
public async Task UpdateUserAsync(string userId, string roleId, string password)
{
using var context = factory.CreateDbContext();
using var transaction = await context.Database.BeginTransactionAsync();
@ -89,7 +89,7 @@ namespace Hcs.WebApp.Services
await transaction.CommitAsync();
}
public async Task<IdentityResult> DeleteUser(string userId)
public async Task<IdentityResult> DeleteUserAsync(string userId)
{
var user = await userManager.FindByIdAsync(userId);
return await userManager.DeleteAsync(user);