Specify a unique identifier attribute for an object across webapi Models
问题 In a POST call to a WebApi I am trying to return a Created(newobject) thing. But there is no signature for Created in ApiController that can only take the object and do the rest. It works fine if I return something like: return Created(newobject.blahid.ToString(), newobject); or if I do a return CreatedAtRoute("DefaultApi", new { controller = ControllerContext.ControllerDescriptor.ControllerName, id = newobject.blahid.ToString()}, newobject); I want to simplify this to: return Created