コード例 #1
0
 protected override void Seed(NoDaysOffAppContext context)
 {
     TenantConfiguration.Seed(context);
     DashboardConfiguration.Seed(context);
     DayConfiguration.Seed(context);
     TileConfiguration.Seed(context);
     BoundedContextConfiguration.Seed(context);
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConsumerService"/> class.
 /// </summary>
 /// <param name="boundedContextConfiguration">The <see cref="BoundedContextConfiguration" />.</param>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> for current <see cref="Execution.ExecutionContext"/>.</param>
 /// <param name="eventHorizonConsents">The <see cref="EventHorizonConsentsConfiguration" />.</param>
 /// <param name="tenants">The <see cref="ITenants"/> system.</param>
 /// <param name="getEventFetchers">The <see cref="FactoryFor{T}" /> <see cref="IEventFetchers" />.</param>
 /// <param name="dispatchers">The <see cref="IReverseCallDispatchers" />.</param>
 /// <param name="logger"><see cref="ILogger"/> for logging.</param>
 public ConsumerService(
     BoundedContextConfiguration boundedContextConfiguration,
     IExecutionContextManager executionContextManager,
     EventHorizonConsentsConfiguration eventHorizonConsents,
     ITenants tenants,
     FactoryFor <IEventFetchers> getEventFetchers,
     IReverseCallDispatchers dispatchers,
     ILogger <ConsumerService> logger)
 {
     _thisMicroservice        = boundedContextConfiguration.BoundedContext;
     _executionContextManager = executionContextManager;
     _eventHorizonConsents    = eventHorizonConsents;
     _tenants          = tenants;
     _getEventFetchers = getEventFetchers;
     _dispatchers      = dispatchers;
     _logger           = logger;
 }
コード例 #3
0
        /// <inheritdoc/>
        public BoundedContextConfiguration Load(string relativePath)
        {
            if (_instance != null)
            {
                return(_instance);
            }

            var path = GetPath(relativePath);

            if (!File.Exists(path))
            {
                _logger.Error($"Bounded context configuration expected at path {path} was not found");
                throw new MissingBoundedContextConfiguration(path);
            }

            var json          = File.ReadAllText(path);
            var configuration = _serializer.FromJson <BoundedContextConfiguration>(json, _serializationOptions);

            _instance = configuration;
            return(_instance);
        }