public CommandsCollection(IEventsApiClient apiClient, TelegramBotService telegramService) { commands = new Dictionary <string, ICommand>(); var types = typeof(Startup).Assembly.GetTypes() .Where(type => typeof(ICommand).IsAssignableFrom(type) && !type.IsAbstract && type.IsClass); foreach (var type in types) { var instance = (ICommand)Activator.CreateInstance(type, apiClient, telegramService); var name = instance.GetType().GetProperty("CommandName").GetValue(instance).ToString(); commands.TryAdd(name, instance); } }
public EventsApi(IBitmovinApiClientFactory apiClientFactory) { _apiClient = apiClientFactory.CreateClient <IEventsApiClient>(); }
public GetEventsCommand(IEventsApiClient apiClient, TelegramBotService telegramService) { this.apiClient = apiClient; this.telegramService = telegramService; }