示例#1
0
        private void InitContainer(ContainerBuilder ioc, WithdrawalRequestSchedulerSettings settings, ILog log)
        {
#if DEBUG
            log.WriteInfoAsync("WithdrawalRequestScheduler.Job", "App start", null, $"AppSettings : {settings.ToJson()}").Wait();
#else
            log.WriteInfoAsync("WithdrawalRequestScheduler.Job", "App start", null, $"AppSettings : private").Wait();
#endif
            ioc.RegisterInstance(log);
            ioc.RegisterInstance(settings);

            ioc.RegisterInstance(new CashOutAttemptRepository(new AzureTableStorage <CashOutBaseEntity>(settings.CashOutAttemptConnString, "CashOutAttempt", log)));

            ioc.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource());
        }
示例#2
0
        public ContainerBuilder Bind(WithdrawalRequestSchedulerSettings settings)
        {
            var logToTable = new LogToTable(new AzureTableStorage <LogEntity>(settings.LogsConnString, "LogWithdrawalRequestSchedulerError", null),
                                            new AzureTableStorage <LogEntity>(settings.LogsConnString, "LogWithdrawalRequestSchedulerWarning", null),
                                            new AzureTableStorage <LogEntity>(settings.LogsConnString, "LogWithdrawalRequestSchedulerInfo", null));

#if DEBUG
            var log = new LogToTableAndConsole(logToTable, new LogToConsole());
#else
            var log = logToTable;
#endif
            var ioc = new ContainerBuilder();
            InitContainer(ioc, settings, log);
            return(ioc);
        }
示例#3
0
        public CheckWithdrawalTransactionStatusFunction(CashOutAttemptRepository cashOutAttemptRepository, WithdrawalRequestSchedulerSettings settings, ILog log)
        {
            _cashOutAttemptRepository = cashOutAttemptRepository;
            _settings = settings;
            _log      = log;


            SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings
            {
                Formatting            = Newtonsoft.Json.Formatting.Indented,
                DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
                DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
                NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
                ContractResolver      = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
                Converters            = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter>
                {
                    new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
                }
            };
        }