This commit is contained in:
@@ -267,7 +267,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
/// <param name="inObj"></param>
|
/// <param name="inObj"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> PostWidget([FromBody] Widget inObj)
|
public async Task<IActionResult> PostWidget([FromBody] Widget inObj, ApiVersion apiVersion)
|
||||||
{
|
{
|
||||||
if (!serverState.IsOpen)
|
if (!serverState.IsOpen)
|
||||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||||
@@ -287,7 +287,12 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (o == null)
|
if (o == null)
|
||||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||||
else
|
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));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -262,10 +262,10 @@ namespace AyaNova
|
|||||||
{
|
{
|
||||||
_log.LogDebug("BOOT: configuring request pipeline...");
|
_log.LogDebug("BOOT: configuring request pipeline...");
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
// if (env.IsDevelopment())
|
||||||
{
|
// {
|
||||||
app.UseDeveloperExceptionPage();
|
// app.UseDeveloperExceptionPage();
|
||||||
}
|
// }
|
||||||
//Store a reference to the dependency injection service for static classes
|
//Store a reference to the dependency injection service for static classes
|
||||||
ServiceProviderProvider.Provider = app.ApplicationServices;
|
ServiceProviderProvider.Provider = app.ApplicationServices;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user