Beispiel #1
0
 // To delete the marriage you want to delete and not all of them
 public static async Task DeleteMarriageOrProposal(Marriage marriage)
 {
     using var db = new NamikoDbContext();
     db.Marriages.Remove(marriage);
     await db.SaveChangesAsync();
 }
Beispiel #2
0
 // You already have the marriage obj at the point you want to set married to true, so you can do it manually and just update
 public static async Task UpdateMarriage(Marriage marriage)
 {
     using var db = new NamikoDbContext();
     db.Marriages.Update(marriage);
     await db.SaveChangesAsync();
 }