public IHttpActionResult Put(Test test) { if (test == null) { return BadRequest("Argument Null"); } var existing = _Db.FirstOrDefault(c => c.Id == test.Id); if (existing == null) { return NotFound(); } existing.Content = test.Content; return Ok(); }
public IHttpActionResult Post(Test test) { if (test == null) { return BadRequest("Argument Null"); } var companyExists = _Db.Any(c => c.Id == test.Id); if (companyExists) { return BadRequest("Exists"); } _Db.Add(test); return Ok(); }