diff --git a/ConfectioneryDatabaseImplement/ImplementerStorage.cs b/ConfectioneryDatabaseImplement/ImplementerStorage.cs index 948e231..2550b58 100644 --- a/ConfectioneryDatabaseImplement/ImplementerStorage.cs +++ b/ConfectioneryDatabaseImplement/ImplementerStorage.cs @@ -15,6 +15,7 @@ namespace ConfectioneryDatabaseImplement.Implements if (res != null) { context.Implementers.Remove(res); + context.SaveChanges(); } return res?.GetViewModel; } @@ -69,6 +70,7 @@ namespace ConfectioneryDatabaseImplement.Implements if (res != null) { context.Implementers.Add(res); + context.SaveChanges(); } return res?.GetViewModel; } @@ -77,7 +79,11 @@ namespace ConfectioneryDatabaseImplement.Implements { using var context = new ConfectioneryDatabase(); var res = context.Implementers.FirstOrDefault(x => x.Id == model.Id); - res?.Update(model); + if (res != null) + { + res.Update(model); + context.SaveChanges(); + } return res?.GetViewModel; } }