public async Task <IHttpActionResult> Post(SpellbookCreateRequest request) { if (ModelState.IsValid) { var spellbook = new Spellbook() { Name = request.Name }; int?spellbookId = await _spellbookRepo.AddAsync(spellbook); if (spellbookId.HasValue) { // var url = Url.Link("DefaultApi", new { controller = "Spellbook", id = spellbookId.Value }); var url = $"/spellbook/details/{spellbookId}"; var info = spellbook.GetShortInfo(); return(Created(url, info)); } return(InternalServerError()); } return(BadRequest(ModelState)); }