Exemple #1
0
    public ActionResult <Model.Pet> Update([FromBody] Model.Pet pet)
    {
        using (var scope = new TransactionScope())
        {
            _updatePet.Execute(pet);
            scope.Complete();
        }

        return(Ok(pet));
    }
Exemple #2
0
    public ActionResult <Model.Pet> Insert([FromBody] Model.Pet pet)
    {
        using (var scope = new TransactionScope())
        {
            var petId = _insertPet.Execute(pet);
            scope.Complete();

            pet.Id = petId;
        }

        return(Ok(pet));
    }