/// <summary> /// Initialises the service /// </summary> /// <returns></returns> public void Start() { var startables = _container.GetAllInstances <IStartable>() .OrderBy(x => (byte)x.StartupPriority) .ToList(); foreach (var startable in startables) { startable.Start(); } _logger.Info($"{nameof(Service)}.{nameof(Start)}", new LogItem("Event", "Service Started"), new LogItem("Name", ServiceInfo.Name)); }
public void Start() { var dataEntities = _containerFacade.GetAllInstances <DataEntityBase>(); foreach (var dataEntity in dataEntities) { var method = typeof(MongoStore).GetMethod(nameof(GetOrCreateCollection), BindingFlags.NonPublic | BindingFlags.Instance); method.MakeGenericMethod(dataEntity.GetType()).Invoke(this, new object[] { }); } }
public void Start() { var dataEntities = _containerFacade.GetAllInstances <DataEntity>(); foreach (var dataEntity in dataEntities) { var method = typeof(DynamoStore).GetMethod(nameof(GetOrCreateTable), BindingFlags.NonPublic | BindingFlags.Instance); if (method != null) { method.MakeGenericMethod(dataEntity.GetType()).Invoke(this, new object[] { }); } } SetupHealthCheck(); }
private bool TryFindConsumer(Guid type, out IBackplaneConsumer consumer) { consumer = _container.GetAllInstances <IBackplaneConsumer>().FirstOrDefault(x => x.ConsumesType == type); return(consumer != null); }