コード例 #1
0
        public Owner UpdateFullOwner(Owner theNewOwner, Owner theOldOwner)
        {
            var updatedOwner = _ctx.Update(theNewOwner).Entity;

            _ctx.SaveChanges();
            return(updatedOwner);
        }
コード例 #2
0
        public PetType UpdatePetType(PetType theNewPetType, PetType theOldPetType)
        {
            var updatedType = _ctx.Update(theNewPetType).Entity;

            _ctx.SaveChanges();
            return(updatedType);
        }
コード例 #3
0
        public PetColor UpdatePetColor(PetColor theNewPetColor)
        {
            var updatedColor = _ctx.Update(theNewPetColor).Entity;

            _ctx.SaveChanges();
            return(updatedColor);
        }
コード例 #4
0
        public User EditUser(User alteredUser)
        {
            var finishedUser = _ctx.Update(alteredUser).Entity;

            _ctx.SaveChanges();
            return(finishedUser);
        }
コード例 #5
0
        public Pet UpdateFullPet(Pet theNewPet)
        {
            _ctx.Attach(theNewPet.PetOwner);
            _ctx.Attach(theNewPet.PetType);
            var updatedPet = _ctx.Update(theNewPet).Entity;

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