Exemple #1
0
        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);
            //    }
            //}
        }
Exemple #2
0
 public UpdateOpenHouseCommandHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #3
0
 public RemovePropertyListingCommandHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #4
0
 public OpenHOuseListQueryHanldder(AppMarketingDbDataContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #5
0
 public PieChartDataQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #6
0
 public CreateOpenHouseAttendeeCommandHandler(AppMarketingDbDataContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #7
0
 public PublishedListingQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #8
0
 public EventHandler(IMessageHandler messageHandler, IMessagePublisher messagePublisher, AppMarketingDbDataContext context)
 {
     _messageHandler   = messageHandler;
     _messagePublisher = messagePublisher;
     _context          = context;
 }
Exemple #9
0
 public ApproveApplicationCommandHandler(AppMarketingDbDataContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #10
0
 public ScreenApplicationCommandHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #11
0
 public AllRentalPropertiesQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #12
0
 public PropertyListingDetailsQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #13
0
 public CoApplicantListQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #14
0
 public AddImageToPropertyCommandHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #15
0
 public ApplicationListQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #16
0
 public UpdatePropertyListingCommandHandler(AppMarketingDbDataContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #17
0
 public GetBarChartDataQueryHandler2(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #18
0
 public AllPropertyImagesListQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }
Exemple #19
0
 public RentalPropertyDetailsQueryHandler(AppMarketingDbDataContext context)
 {
     _context = context;
 }