private static void InjectSettings(ServiceConfiguration configuration)
 {
     configuration.AddConfiguration <WebServiceSettings>();
     configuration.AddConfiguration <RabbitMqSettings>();
     configuration.AddConfiguration <List <ServiceEndpointSettings> >();
     configuration.AddConfiguration <List <ClientSetting> >();
 }
Beispiel #2
0
 // POST api/configuration
 public HttpResponseMessage Post([FromBody] ServiceConfig value)
 {
     if (!ModelState.IsValid)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
     }
     try
     {
         ServiceConfiguration.AddConfiguration(value);
     }
     catch (ArgumentException exception)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, exception.Message));
     }
     catch (Exception e)
     {
         LogService.WriteError(e);
         throw;
     }
     return(new HttpResponseMessage(HttpStatusCode.OK));
 }