public Guarantor UpdateGuarantor(Guarantor guarantorChanges) { var guarantor = context.Guarantors.Attach(guarantorChanges); guarantor.State = Microsoft.EntityFrameworkCore.EntityState.Modified; context.SaveChanges(); return(guarantorChanges); }
public Guarantor DeleteGuarantor(int id) { Guarantor guarantor = context.Guarantors.Find(id); if (guarantor != null) { context.Guarantors.Remove(guarantor); context.SaveChanges(); } return(guarantor); }
//---------------------------------------Guarantor---------------------------------------------------- public Guarantor AddGuarantor(Guarantor guarantor) { context.Add(guarantor); context.SaveChanges(); return(guarantor); }