// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddSingleton <ITomatoLogClient, TomatoLogClientRabbitMQ>(factory => { var options = this.Configuration.GetSection("TomatoLog").Get <EventRabbitMQOptions>(); var client = new TomatoLogClientRabbitMQ(options); return(client); }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddSingleton <ITomatoLogClient>(factory => { var options = this.Configuration.GetSection("TomatoLog").Get <EventRabbitMQOptions>(); var client = new TomatoLogClientRabbitMQ(options); return(client); }); services.AddControllers(); }