public HttpResponseMessage Post([FromBody] AddOrUpdateTestRestValueDto args) { var newValue = _values.Create(args.Value); return(Request.CreateResponse(HttpStatusCode.Created, new { Url = JsonConfigAccessor.Config.FullHostUrls.First() + $"/api/testrest/{newValue.Key}" })); }
public HttpResponseMessage Put(int id, [FromBody] AddOrUpdateTestRestValueDto args) { if (!_values.ContainsKey(id)) { return(Request.CreateResponse(HttpStatusCode.NotFound, new HttpError($"Value with id {id} not found"))); } _values[id] = args.Value; return(Request.CreateResponse(HttpStatusCode.OK)); }