// 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(); }
// 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(); }