public Customer Delete(int id) { var customerEntry = _ctx.Remove(new Customer() { Id = id }); _ctx.SaveChanges(); return(customerEntry.Entity); }
public City Delete(int zipCode) { _ctx.CityTourists.RemoveRange(_ctx.CityTourists.Where(ct => ct.CityId == zipCode)); var entry = _ctx.Remove(new City() { ZipCode = zipCode }); _ctx.SaveChanges(); return(entry.Entity); }