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"]; string connName = configSection["ConnectionName"]; // setup messagehandler RabbitMQMessageHandler messageHandler = new RabbitMQMessageHandler(host, userName, password, exchange, connName, "asset_created.marketing", "asset_created.#"); // subscribe/listen to queue RabbitMQMessageHandler messageHandler2 = new RabbitMQMessageHandler(host, userName, password, exchange, connName, "lease_finalized.marketing", "lease_finalized.#"); // subscribe/listen to queue // setup DBContext var sqlConnectionString = Config.GetConnectionString("AppDbConnection2"); var dbContextOptions = new DbContextOptionsBuilder <AppMarketingDbDataContext>() .UseSqlServer(sqlConnectionString) .Options; var dbContext = new AppMarketingDbDataContext(dbContextOptions); //var mongoConnectionString = Config.GetConnectionString("MongoDbConnection"); //var mongoClient = new MongoClient(mongoConnectionString); //var mongoDb = mongoClient.GetDatabase("MessageDb"); //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 eventHandler = new EventHandlers.EventHandler(messageHandler, dbContext); eventHandler.Start(); EventHandlers.EventHandler eventHandler2 = new EventHandlers.EventHandler(messageHandler2, dbContext); eventHandler2.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 UpdateOpenHouseCommandHandler(AppMarketingDbDataContext context) { _context = context; }
public RemovePropertyListingCommandHandler(AppMarketingDbDataContext context) { _context = context; }
public OpenHOuseListQueryHanldder(AppMarketingDbDataContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public PieChartDataQueryHandler(AppMarketingDbDataContext context) { _context = context; }
public CreateOpenHouseAttendeeCommandHandler(AppMarketingDbDataContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public PublishedListingQueryHandler(AppMarketingDbDataContext context) { _context = context; }
public EventHandler(IMessageHandler messageHandler, IMessagePublisher messagePublisher, AppMarketingDbDataContext context) { _messageHandler = messageHandler; _messagePublisher = messagePublisher; _context = context; }
public ApproveApplicationCommandHandler(AppMarketingDbDataContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public ScreenApplicationCommandHandler(AppMarketingDbDataContext context) { _context = context; }
public AllRentalPropertiesQueryHandler(AppMarketingDbDataContext context) { _context = context; }
public PropertyListingDetailsQueryHandler(AppMarketingDbDataContext context) { _context = context; }
public CoApplicantListQueryHandler(AppMarketingDbDataContext context) { _context = context; }
public AddImageToPropertyCommandHandler(AppMarketingDbDataContext context) { _context = context; }
public ApplicationListQueryHandler(AppMarketingDbDataContext context) { _context = context; }
public UpdatePropertyListingCommandHandler(AppMarketingDbDataContext context, IMessagePublisher messagePublisher) { _context = context; _messagePublisher = messagePublisher; }
public GetBarChartDataQueryHandler2(AppMarketingDbDataContext context) { _context = context; }
public AllPropertyImagesListQueryHandler(AppMarketingDbDataContext context) { _context = context; }
public RentalPropertyDetailsQueryHandler(AppMarketingDbDataContext context) { _context = context; }