public AlugarJogoService(IAlugadoDao alugadoDao, ISender sender) { _alugadoDao = alugadoDao; _sender = sender; this.TopicName = UtilitiesConfig.GetAppSetting("AlugarJogoTopic"); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { string connectionStrings = UtilitiesConfig.GetAppSetting("ProjetoEstudo"); services.AddDbContext <BancoContext>(db => { db.UseSqlServer(connectionStrings); }); services.AddControllers(options => { options.Filters.Add(typeof(ErrorResponseFilter)); }).AddXmlSerializerFormatters(); services.AddHealthChecks() .AddDbContextCheck <BancoContext>(nameof(BancoContext)); //DAO services.AddTransient <IJogoDao, JogoDao>(); services.AddTransient <IClienteDao, ClienteDao>(); services.AddTransient <IAlugadoDao, AlugadoDao>(); //SERVICE services.AddTransient <IJogoService, JogoService>(); services.AddTransient <IAlugarJogo, AlugarJogoService>(); services.AddTransient <IDevolverJogo, DevolverJogoService>(); //SERVICE_BUS services.AddTransient <ISender, Sender>(); }
public Sender() { this.ConnectioString = UtilitiesConfig.GetAppSetting("AzureServiceBus"); }