Ejemplo n.º 1
0
        public SelfAwakerServiceBase(IConfiguration configuration, ISerializer serializer)
        {
            Logger        = CustomLogFactory.CreateLogger(this.GetType());
            Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
            Serializer    = serializer ?? throw new ArgumentNullException(nameof(serializer));

            Enabled = configuration.GetValue <bool>($"{this.GetType().FullName}:Enabled", false);
            if (Enabled)
            {
                InitializeIfEnabled();
            }
        }
Ejemplo n.º 2
0
        public SelfAwakeService(IConfiguration configuration, params Assembly[] awakerAssemblies)
        {
            Configuration = configuration;
            Logger        = CustomLogFactory.CreateLogger(this.GetType());

            var option = new AwakeWorkerOption();

            configuration.Bind($"{this.GetType().FullName}", option);

            Option = option ?? throw new ArgumentNullException(nameof(Configuration) + $":{this.GetType().FullName}");

            if (Option.Enabled && awakerAssemblies.Count() > 0)
            {
                InitializeIfEnabled(awakerAssemblies);
            }
        }
 public AwakeController(ISelfAwakeService service)
 {
     this.Logger = CustomLogFactory.CreateLogger(this.GetType());
     Service     = service;
 }