dropping GCM support

This commit is contained in:
Paul Schneider 2019-05-08 01:35:10 +01:00
commit df9ff16c5c
36 changed files with 6228 additions and 149 deletions

View file

@ -708,9 +708,13 @@ namespace Yavsc.Controllers
async Task<IdentityResult> DeleteUser(string userId)
{
ApplicationUser user = await _userManager.FindByIdAsync(userId);
_dbContext.GCMDevices.RemoveRange( _dbContext.GCMDevices.Where(g => g.DeviceOwnerId == userId ));
// TODO add an owner to maillings
_dbContext.MailingTemplate.RemoveRange(_dbContext.MailingTemplate.Where( t=>t.ManagerId == userId ));
_dbContext.DeviceDeclaration.RemoveRange( _dbContext.DeviceDeclaration.Where(g => g.DeviceOwnerId == userId ));
foreach (var template in _dbContext.MailingTemplate.Where( t=>t.ManagerId == userId ))
{
template.ManagerId = template.SuccessorId;
}
return await _userManager.DeleteAsync(user);
}