public override bool Delete(Supplier supplier) { Address address = _context.Addresses.Find(supplier.AddressId); PhoneNumber number = _context.PhoneNumbers.Find(supplier.PhoneNumberId); EmailAddress email = _context.EmailAddresses.Find(supplier.EmailAddressId); _context.Addresses.Remove(address); _context.PhoneNumbers.Remove(number); _context.EmailAddresses.Remove(email); _context.Suppliers.Remove(supplier); _context.SaveChanges(); _context.Dispose(); return(true); }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (disposing) { _ERSAIDB?.Dispose(); _IMSDB?.Dispose(); _PayslipsDb?.Dispose(); } base.Dispose(disposing); }