Exemplo n.º 1
0
        public Pet DeletePet(Pet pet)
        {
            var petRemoved = _ctx.Remove(pet).Entity;

            _ctx.SaveChanges();
            return(petRemoved);
        }
        public Order DeleteOrder(Order order)
        {
            var orderRemoved = _ctx.Remove(order).Entity;

            _ctx.SaveChanges();
            return(orderRemoved);
        }
        public Owner Delete(int id)
        {
            Owner owner = ReadByID(id);

            context.Remove(owner);
            context.SaveChanges();
            return(owner);
        }
        public Pet Delete(int id)
        {
            Pet pet = ReadByID(id);

            context.Remove(pet);
            context.SaveChanges();
            return(pet);
        }
        public Owner Delete(int id)
        {
            var ownerRemoved = _ctx.Remove(new Owner {
                ID = id
            }).Entity;

            _ctx.SaveChanges();
            return(ownerRemoved);
        }
        public void DeleteOwner(int id)
        {
            Owner delteOwner = _context.Remove(new Owner()
            {
                Id = id
            }).Entity;

            _context.SaveChanges();
        }
Exemplo n.º 7
0
        public Pet DeletePet(int id)
        {
            var removed = _context.Remove(new Pet {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(removed);
        }
Exemplo n.º 8
0
        public Customer DeleteCustomer(int id)
        {
            var customerRemoved = _ctx.Remove(new Customer {
                CustomerId = id
            }).Entity;

            _ctx.SaveChanges();
            return(customerRemoved);
        }
Exemplo n.º 9
0
        public Owner DeleteOwnerByID(int id)
        {
            Owner ownerToReturn = _context.Remove(new Owner()
            {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(ownerToReturn);
        }
Exemplo n.º 10
0
        public Owner Delete(int id)
        {
            var owner = new Owner();

            Owner.Id = id;
            var ownerRemoved = _Context.Remove(owner).Entity;

            _Context.SaveChanges();
            return(ownerRemoved);
        }
Exemplo n.º 11
0
        public Owner DeleteOwner(int id)
        {
            var ownerDeleted = _ctx.Owners.FirstOrDefault(o => o.Id == id);

            if (ownerDeleted != null)
            {
                _ctx.Remove(ownerDeleted);
                _ctx.SaveChanges();
            }

            return(ownerDeleted);
        }
Exemplo n.º 12
0
 public void RemoveUser(long id)
 {
     _ctx.Remove(GetUser(id));
     _ctx.SaveChanges();
 }
Exemplo n.º 13
0
 public Pet DeletePetByID(int id)
 {
     Pet petToReturn = _context.Remove(new Pet() { Id = id }).Entity;
     _context.SaveChanges();
     return petToReturn;
 }