diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 14abbc1..144b446 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/Controllers/InventarController.cs b/Controllers/InventarController.cs index e19b229..01d753a 100644 --- a/Controllers/InventarController.cs +++ b/Controllers/InventarController.cs @@ -19,7 +19,7 @@ namespace BuecherwurmAPI.Controllers } // GET Inventar [HttpGet] - public ActionResult> GetAllCopies() + public ActionResult> GetAllCopies() { var copies = _repository.GetAllCopies(); return Ok(copies); @@ -27,15 +27,12 @@ namespace BuecherwurmAPI.Controllers // POST Inventar [HttpPost] - public ActionResult> NeuesExemplar(Copy copy) + public ActionResult> NeuesExemplar(Copy copy) { - return Ok(new Copy { CopyId = copy.CopyId, ProductId = book.ProductId, - LendTime = copy.LendTime, - LendType = copy.LendType }); } @@ -55,7 +52,7 @@ namespace BuecherwurmAPI.Controllers // DELETE inventory/{id} - /*[HttpDelete("id")] + [HttpDelete("id")] public ActionResult> ExemplarEntfernen(int id) { var copy = _repository.GetCopyById(id); @@ -65,7 +62,7 @@ namespace BuecherwurmAPI.Controllers } _repository.ExemplarEntfernen(copy); return NoContent(); - }*/ + } } diff --git a/Models/Copy.cs b/Models/Copy.cs new file mode 100644 index 0000000..4ed14cb --- /dev/null +++ b/Models/Copy.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace BuecherwurmAPI.Models +{ + public class Copy + { + [Key] + [Required] + public int CopyId { get; set; } + [Required] + public int ProductId { get; set; } + } + +} \ No newline at end of file