This commit is contained in:
2019-10-21 22:26:48 +00:00
parent e0ce0cc7fa
commit 0ae191daca
2 changed files with 11 additions and 6 deletions

View File

@@ -267,7 +267,7 @@ namespace AyaNova.Api.Controllers
/// <param name="inObj"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> PostWidget([FromBody] Widget inObj)
public async Task<IActionResult> PostWidget([FromBody] Widget inObj, ApiVersion apiVersion)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
@@ -287,7 +287,12 @@ namespace AyaNova.Api.Controllers
if (o == null)
return BadRequest(new ApiErrorResponse(biz.Errors));
else
return CreatedAtAction("GetWidget", new { id = o.Id }, new ApiCreatedResponse(o));
{
//originally but throwing exception since move to 3.1
//return CreatedAtAction("GetWidget", new { id = o.Id }, new ApiCreatedResponse(o));
return CreatedAtAction(nameof(WidgetController.GetWidget), new { id = o.Id, version = apiVersion.ToString() }, new ApiCreatedResponse(o));
}
}

View File

@@ -262,10 +262,10 @@ namespace AyaNova
{
_log.LogDebug("BOOT: configuring request pipeline...");
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
// if (env.IsDevelopment())
// {
// app.UseDeveloperExceptionPage();
// }
//Store a reference to the dependency injection service for static classes
ServiceProviderProvider.Provider = app.ApplicationServices;