public IActionResult Add([FromBody] Thing thing) { if (thing == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Thing newThing = _thingsRepository.Add(thing); return(CreatedAtRoute("GetSingleThing", new { id = newThing.Id }, newThing)); }
public void SetThing(Things thing) { _thingRepository.Add(thing); }