Add database commits

This commit is contained in:
2023-10-30 21:22:06 +01:00
parent 6556e17146
commit 5792d2fcf4
3 changed files with 11 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ namespace GerbilManagerWebAPI.Controllers
}
this.unitOfWork.GerbilRepository.Insert(gerbil);
this.unitOfWork.Save();
return CreatedAtAction(nameof(GetGerbil), new { id = gerbil.Id}, gerbil.AsDto());
}
@@ -85,6 +86,8 @@ namespace GerbilManagerWebAPI.Controllers
};
unitOfWork.GerbilRepository.Update(updatedGerbil);
this.unitOfWork.Save();
return NoContent();
}
@@ -99,6 +102,7 @@ namespace GerbilManagerWebAPI.Controllers
}
unitOfWork.GerbilRepository.Delete(existingGerbil);
this.unitOfWork.Save();
return NoContent();
}