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

@@ -62,6 +62,7 @@ namespace GerbilManagerWebAPI.Controllers
};
this.unitOfWork.LitterRepository.Insert(litter);
this.unitOfWork.Save();
return CreatedAtAction(nameof(GetLitter), new { id = litter.Id}, litter.AsDto());
}
@@ -84,6 +85,8 @@ namespace GerbilManagerWebAPI.Controllers
};
unitOfWork.LitterRepository.Update(updatedLitter);
this.unitOfWork.Save();
return NoContent();
}
@@ -98,6 +101,7 @@ namespace GerbilManagerWebAPI.Controllers
}
unitOfWork.LitterRepository.Delete(existingLitter);
this.unitOfWork.Save();
return NoContent();
}