예제 #1
0
        public Owner delete(int id)
        {
            var ownersRemoved = _PSActx
                                .Remove(new Owner {
                OwnerId = id
            }).Entity;

            _PSActx.SaveChanges();
            return(ownersRemoved);
        }
예제 #2
0
        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);
        }