From 935f321d80b138b97b18f3959ded7d26a4474e30 Mon Sep 17 00:00:00 2001 From: Fredi Kats Date: Sun, 4 Sep 2022 20:39:33 +0400 Subject: [PATCH] hotfix: missed updated on EF --- .../Github/AddGithubUserAssociationHandler.cs | 1 + .../Github/RemoveGithubUserAssociationHandler.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Application/Kysect.Shreks.Application.Handlers/Github/AddGithubUserAssociationHandler.cs b/Source/Application/Kysect.Shreks.Application.Handlers/Github/AddGithubUserAssociationHandler.cs index 3cb3a3dc2..c5ed99db4 100644 --- a/Source/Application/Kysect.Shreks.Application.Handlers/Github/AddGithubUserAssociationHandler.cs +++ b/Source/Application/Kysect.Shreks.Application.Handlers/Github/AddGithubUserAssociationHandler.cs @@ -26,6 +26,7 @@ public async Task Handle(Command request, CancellationToken cancellati _context.Users.Update(student.User); await _context.SaveChangesAsync(cancellationToken); + return new Response(); } } \ No newline at end of file diff --git a/Source/Application/Kysect.Shreks.Application.Handlers/Github/RemoveGithubUserAssociationHandler.cs b/Source/Application/Kysect.Shreks.Application.Handlers/Github/RemoveGithubUserAssociationHandler.cs index 0d06e15c3..f3b90a369 100644 --- a/Source/Application/Kysect.Shreks.Application.Handlers/Github/RemoveGithubUserAssociationHandler.cs +++ b/Source/Application/Kysect.Shreks.Application.Handlers/Github/RemoveGithubUserAssociationHandler.cs @@ -22,7 +22,8 @@ public async Task Handle(Command request, CancellationToken cancellati GithubUserAssociation githubUserAssociation = student.User.Associations.OfType().Single(); student.User.RemoveAssociation(githubUserAssociation); - _context.Users.Update(student.User); + _context.UserAssociations.Remove(githubUserAssociation); + await _context.SaveChangesAsync(cancellationToken); return new Response();