Ejemplo n.º 1
0
        public Pet DeletePet(int id)
        {
            var petRemoved = _ctx.Remove(new Pet {
                Id = id
            }).Entity;

            _ctx.SaveChanges();
            return(petRemoved);
        }
        public Owner DeleteOwner(int id)
        {
            //var petsToRemove = _ctx.Pets.Where(p => p.Owner.id == id);
            //_ctx.RemoveRange(petsToRemove);
            var ownerRemoved = _ctx.Remove(new Owner {
                id = id
            }).Entity;

            _ctx.SaveChanges();
            return(ownerRemoved);
        }