From f76303a1cf7c45b3eb8578706d2251d249842079 Mon Sep 17 00:00:00 2001 From: David Renner Date: Thu, 28 May 2020 10:31:04 +0200 Subject: [PATCH] =?UTF-8?q?Update:=20Copy=20Model=20hinzugef=C3=BCgt,=20Co?= =?UTF-8?q?ntroller=20gefixt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/slnx.sqlite | Bin 249856 -> 249856 bytes Controllers/InventarController.cs | 11 ++++------- Models/Copy.cs | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 Models/Copy.cs diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 14abbc1858c3fe9d7dba3d976e6e106c26326e1c..144b446d76af3426506c2a711436ee55dada0d43 100644 GIT binary patch delta 1399 zcmaJ>YfKzf6ux(7cG+Q=d!RdmyP~iyRU@|SF0WmXrfz9Pe(*4qw3{}tsilXLF6rbDQzKJyEr_GaQSlT3xuaTNP!?>TN2K zRC{;Cl0C_kqW|p4%jF$Xh@bU_&m!9jAA43I`hn0c*)mOpTjF5!hUj)bdw5r z5cV*!E=sy{K*RwX-X-!bv`RadFGm07J&dxkNnGL!@G5Uv(f6cZal4q*0)!C!2xnm$ zUS`rnAp`?(iqYH(G&Ejrz0gtQETKc=8y$I~4PlIJiiKlhUubv!7N*nV)tN`;5c~O6;^mis3BHQ{^Hl*6a{aSCZrJ*#_`ckvE*L_4q zl&gF!+SQziHq8GMnogMyG(<#2kT-c*pb`{J%0}RSXH=}~sy)ox@5gqdz%@PByp$A9 z%n6`dadDb4q=#l4mYtP!>P#E1p!xGnxSXo3g#t{nYH!n788AYMP$8pD*$5 z4$y^}5cbp3**4C*uZr$Hvrm6*K4htv{zh(T6cY=41*2r0^et%61bd~k(x)&kjRHvT zfFIoO5xI}}$Y10+@)AjscIgB7m`sp!WF8K~lW>X6>P{)Ga2|X^V`_{gt5=hzFsX*^ z)e={PuM1yhY-2`jpPf_8qu0gx@tPud$YsPE@3m`cUpjBBaNLN1u`rh)Sc)4{hi z!9;+alGZA__3TRfeq zYD-&Y4KuaLSHj14w|l%nVkwHGx-)7jkx}A%^nvh02n#8GQ#_JxrvB6bv8l)h-CASH$lH~;fc^n&WkDXlmHF05(;s*Z0 zHC#asKVc5v<2;5jD9-;JV>pHPF@h1zRnrYVnA%{%&%|Wo=TkL;)I;z$zQZ|;uxo6B z4Pia=ux7l3C)rWf$?n2q*pG-H{Y}<9{dT&sm=>TojX_cfdxCfhLl$VY{fFN2t-xtw zL6qPse#8Xc6dg$*ihlG9x_a>FXq{YjI*=^yxbvm@`w!K?YEa|b@?{JF54^ZzBlb{hiu|%q)gUh+n(j`Sz zv6f0+KXtz`T=P%`KQR@hA%1mgue5IcO8#lCT05P4j`{=C8(lzc=}ji%YIaMnB0i4# zc(0ml*t7FMId7akV0bXdhrZft4v2=-c364S^j4GGQ5^B}hFnB@XF6)wF1qcNZ&FzB z1BOry70q}Uqs%AYgopi(FWC-O%NTo+y}>dph8Z@-F0yGH!!x)df3`TpLrchq%#xdm zcKSrp-X+UhExh~kZBSJGvhQ0cpi4=Yiq+-?o&J?XrbwzMyCu7GYo$x7q|HjNlHT@& zlI%&u)e5H+(jyuY2@xd3p=A=Un>)*WmzKH8b$LuxdQ$1GOiIlL^<7h-OlqLwF|4G1 z-hAnd`vh2-T?hBrb>w2Zj_R2lMkl-uj;&pMQRQo{o*r8yYVE3%6u}wEzGB 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