private static void Startup(/*[FromServices] UserManager<ApplicationUser> _userManager*/) { // setup RabbitMQ var configSection = Config.GetSection("RabbitMQ"); string host = configSection["Host"]; string userName = configSection["UserName"]; string password = configSection["Password"]; string exchange = configSection["Exchange"]; // Exchagne2: listening exchange string connName = configSection["ConnectionName"]; // setup messagehandler RabbitMQMessageHandler messageHandlerMarketing = new RabbitMQMessageHandler(host, userName, password, exchange, connName, "app_approved", "app_approved.#"); // "real", ""); listening queue: marketing.lease, RabbitMQMessageHandler messageHandlerAsset = new RabbitMQMessageHandler(host, userName, password, exchange, connName, "asset_created.lease", "asset_created.#"); //setup DBContext // var sqlConnectionString = Config.GetConnectionString("AppDbConnection"); var dbContextOptions = new DbContextOptionsBuilder <AppLeaseManagementDbContext>() .UseSqlServer(sqlConnectionString) .Options; var dbContext = new AppLeaseManagementDbContext(dbContextOptions); //Policy // .Handle<Exception>() // .WaitAndRetry(5, r => TimeSpan.FromSeconds(5), (ex, ts) => { Log.Error("Error connecting to DB. Retrying in 5 sec."); }) // .Execute(() => DBInitializer.Initialize(dbContext)); // start event-handler // EventHandlers.EventHandler eventHandlerMarketing = new EventHandlers.EventHandler(messageHandlerMarketing, dbContext); // Subscribe/Handle message publshied by Marketing Service eventHandlerMarketing.Start(); EventHandlers.EventHandler eventHandlerAsset = new EventHandlers.EventHandler(messageHandlerAsset, dbContext); // Subscribe/Handle message publshied by Asset Service eventHandlerAsset.Start(); //if (_env == "Development") //{ // Log.Information("WorkshopManagement Eventhandler started."); // Console.WriteLine("Press any key to stop..."); // Console.ReadKey(true); // eventHandler.Stop(); //} //else //{ // Log.Information("WorkshopManagement Eventhandler started."); // while (true) // { // Thread.Sleep(10000); // } //} }
public UpdateInvoiceCommandHandler(AppLeaseManagementDbContext context) { _context = context; }
public ServiceRequestDetailsQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public ServiceRequestListByLeaseQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
//private readonly IMediator mediator; public AddInspectionReportToLeaseCommandHandler(AppLeaseManagementDbContext context /*, IMediator _mediator*/) { _context = context; //_mediator = mediator; }
public EventHandler(IMessageHandler messageHandler, AppLeaseManagementDbContext context) { _messageHandler = messageHandler; _context = context; }
public AllInvoicesQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public AddServiceRequestCommandHandler(AppLeaseManagementDbContext context) { _context = context; }
public UpdateVendorCommandHandler(AppLeaseManagementDbContext context) { _context = context; }
public RentalDetailsForReportingQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public UpdateRentalPropertyStatusCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public AddTenantToLeaseCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public WorkOrderListForPropertyQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public AllVendorsListQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
//private readonly IMediator mediator; public AddAddendumItemCommandHandler(AppLeaseManagementDbContext context) { _context = context; }
public LeaseDetailsQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public AllTenantListQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public AddRentPaymentCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public AllRentPaymentHistoryQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public AllWorkOrdersQueryHandler(AppLeaseManagementDbContext context) { _context = context; }
public AddWorkOrderCommandHandler(AppLeaseManagementDbContext context) { _context = context; }
public UpdateTenantCommandHandler(AppLeaseManagementDbContext context) { _context = context; }
public FinalizeLeaseCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public AllRentalPropeprtyListQueryHandler(AppLeaseManagementDbContext context) { _context = context; }