partial void DeleteLivingWill(LivingWill instance);
partial void UpdateLivingWill(LivingWill instance);
public void SaveLivingWill(LivingWill livingWill) { // if its a new client, insert it if (livingWill.LivingWillID == 0) { _db.LivingWills.InsertOnSubmit(livingWill); } else if (_db.LivingWills.GetOriginalEntityState(livingWill) == null) { // we are updating an existing will, but it's not attached // to the data context, so attach it and detect changes _db.LivingWills.Attach(livingWill); _db.LivingWills.Context.Refresh(RefreshMode.KeepCurrentValues, livingWill); } _db.SubmitChanges(); }
partial void InsertLivingWill(LivingWill instance);
public void DeleteLivingWill(LivingWill livingWill) { _db.LivingWills.DeleteOnSubmit(livingWill); _db.LivingWills.Context.SubmitChanges(); }