我需要能够在ServiceStack中禁用特定用户,我想知道这种方法是否正确。
public class UserManagementService : Service
{
public void Put(DisableUser request)
{
var userAuth = UserAuthRepo.GetUserAuthByUserName(request.UserName);
userAuth.LockedDate = DateTime.UtcNow;
UserAuthRepo.SaveUserAuth(userAuth);
}
}