public Owner delete(int id) { var ownersRemoved = _PSActx .Remove(new Owner { OwnerId = id }).Entity; _PSActx.SaveChanges(); return(ownersRemoved); }
public Pet delete(int id) { //var ownersToRemove = _PSActx.Pets // .Where(p => p.PetOwner.OwnerId == id); //_PSActx.RemoveRange(ownersToRemove); var petsRemoved = _PSActx.Remove(new Pet { Id = id }).Entity; _PSActx.SaveChanges(); return(petsRemoved); }