public ActionResult InitializeDataCenter(string id, string registration) { this.id = id; try { var settings = GetData <ConfigurationSettings>(registration); settings = configSetTasks.InitializeDatacenter(id, settings); return(Json(settings)); } catch (Exception ex) { ex.Log(); return(new HttpStatusCodeResult(500, ex.Message)); } }
public HttpResponseMessage InitializeDataCenter(string id, [FromBody] ConfigurationSettings registration) { this.id = id; try { var settings = registration; settings = configSetTasks.InitializeDatacenter(id, settings); return(Request.CreateResponse(HttpStatusCode.OK, settings)); } catch (Exception ex) { ex.Log(); return(Request.CreateResponse(HttpStatusCode.InternalServerError, string.Format("Error: {0}", ex.Message))); } }