Fixed some user deletion issues
This commit is contained in:
parent
aa501244e1
commit
ee9190447f
2 changed files with 5 additions and 2 deletions
|
@ -75,7 +75,7 @@ public class ServiceAdminService
|
|||
|
||||
await Actions[service.Product.Type].Delete(scope.ServiceProvider, service);
|
||||
|
||||
foreach (var share in service.Shares)
|
||||
foreach (var share in service.Shares.ToArray())
|
||||
{
|
||||
serviceShareRepo.Delete(share);
|
||||
}
|
||||
|
|
|
@ -104,6 +104,9 @@ public class UserDeleteService
|
|||
TransactionRepository.Delete(transaction);
|
||||
|
||||
// User
|
||||
UserRepository.Delete(user);
|
||||
|
||||
// We need to use this in order to entity framework not crashing because of the previous deleted data
|
||||
var userToDelete = UserRepository.Get().First(x => x.Id == user.Id);
|
||||
UserRepository.Delete(userToDelete);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue