diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 144b446..fc5da14 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/Controllers/InventarController.cs b/Controllers/InventarController.cs index 01d753a..a9fc7b2 100644 --- a/Controllers/InventarController.cs +++ b/Controllers/InventarController.cs @@ -19,32 +19,32 @@ namespace BuecherwurmAPI.Controllers } // GET Inventar [HttpGet] - public ActionResult> GetAllCopies() + public ActionResult> GetAllItems() { - var copies = _repository.GetAllCopies(); - return Ok(copies); + var items = _repository.GetAllItems(); + return Ok(items); } // POST Inventar [HttpPost] - public ActionResult> NeuesExemplar(Copy copy) + public ActionResult> NewItem(Item item) { - return Ok(new Copy + return Ok(new Item { - CopyId = copy.CopyId, - ProductId = book.ProductId, + Id = item.Id, + BookId = book.ProductId, }); } // GET Inventar/{id} - [HttpGet("{id}", Name = "GetCopyByID")] - public ActionResult> GetCopyByID(int id) + [HttpGet("{id}", Name = "GetItemByID")] + public ActionResult> GetItemByID(int id) { - var copy = _repository.GetCopyById(id); - if (copy != null) + var item = _repository.GetItemById(id); + if (item != null) { - return Ok(copy); + return Ok(item); } return NoContent(); @@ -53,14 +53,14 @@ namespace BuecherwurmAPI.Controllers // DELETE inventory/{id} [HttpDelete("id")] - public ActionResult> ExemplarEntfernen(int id) + public ActionResult> DeleteItem(int id) { - var copy = _repository.GetCopyById(id); - if (copy == null) + var item = _repository.GetItemById(id); + if (item == null) { return NotFound(); } - _repository.ExemplarEntfernen(copy); + _repository.DeleteItem(Item); return NoContent(); } diff --git a/Models/Copy.cs b/Models/Item.cs similarity index 58% rename from Models/Copy.cs rename to Models/Item.cs index 4ed14cb..c6e6012 100644 --- a/Models/Copy.cs +++ b/Models/Item.cs @@ -2,13 +2,13 @@ using System.ComponentModel.DataAnnotations; namespace BuecherwurmAPI.Models { - public class Copy + public class Item { [Key] [Required] - public int CopyId { get; set; } + public int Id { get; set; } [Required] - public int ProductId { get; set; } + public int BookId { get; set; } } } \ No newline at end of file