//Deletes specified Creditor public static void Delete(Creditors creditor) { using (var context = new bankEntities()) { var result = context.Creditors.Where(x => x.IBAN == creditor.IBAN && x.name == creditor.name).First(); context.Creditors.Remove(result); context.SaveChanges(); } }
//Changes the data of specified Creditor public static void Update(Creditors creditor) { using (var context = new bankEntities()) { var result = context.Creditors.Where(x => x.IBAN == creditor.IBAN && x.name == creditor.name).First(); result.lend = creditor.lend; result.endDate = creditor.endDate; result.interest = creditor.interest; context.SaveChanges(); } }