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"]; // 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);
            //    }
            //}
        }
Exemple #2
0
 public UpdateInvoiceCommandHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #3
0
 public ServiceRequestDetailsQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #4
0
 public ServiceRequestListByLeaseQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #5
0
        //private readonly IMediator mediator;

        public AddInspectionReportToLeaseCommandHandler(AppLeaseManagementDbContext context /*, IMediator _mediator*/)
        {
            _context = context;
            //_mediator = mediator;
        }
Exemple #6
0
 public EventHandler(IMessageHandler messageHandler, AppLeaseManagementDbContext context)
 {
     _messageHandler = messageHandler;
     _context        = context;
 }
Exemple #7
0
 public AllInvoicesQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #8
0
 public AddServiceRequestCommandHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #9
0
 public UpdateVendorCommandHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #10
0
 public RentalDetailsForReportingQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #11
0
 public UpdateRentalPropertyStatusCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #12
0
 public AddTenantToLeaseCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #13
0
 public WorkOrderListForPropertyQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #14
0
 public AllVendorsListQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #15
0
        //private readonly IMediator mediator;

        public AddAddendumItemCommandHandler(AppLeaseManagementDbContext context)
        {
            _context = context;
        }
Exemple #16
0
 public LeaseDetailsQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #17
0
 public AllTenantListQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #18
0
 public AddRentPaymentCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #19
0
 public AllRentPaymentHistoryQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #20
0
 public AllWorkOrdersQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #21
0
 public AddWorkOrderCommandHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #22
0
 public UpdateTenantCommandHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }
Exemple #23
0
 public FinalizeLeaseCommandHandler(AppLeaseManagementDbContext context, IMessagePublisher messagePublisher)
 {
     _context          = context;
     _messagePublisher = messagePublisher;
 }
Exemple #24
0
 public AllRentalPropeprtyListQueryHandler(AppLeaseManagementDbContext context)
 {
     _context = context;
 }