public IActionResult Update(string id, GundamModel bookIn)
        {
            var gundam = _gundamService.Get(id);

            if (gundam == null)
            {
                return(NotFound());
            }

            _gundamService.Update(id, bookIn);

            return(NoContent());
        }
Exemplo n.º 2
0
 public void Remove(GundamModel gnd) =>
 _gundams.DeleteOne(gundam => gundam.Id == gnd.Id);
Exemplo n.º 3
0
 public void Update(string id, GundamModel gnd) =>
 _gundams.ReplaceOne(gundam => gundam.Id == id, gnd);
Exemplo n.º 4
0
 public GundamModel Create(GundamModel gnd)
 {
     _gundams.InsertOne(gnd);
     return(gnd);
 }
        public ActionResult <GundamModel> Create(GundamModel gnd)
        {
            _gundamService.Create(gnd);

            return(CreatedAtRoute("GetGundam", new { id = gnd.Id.ToString() }, gnd));
        }