public static async Task <HttpResponseMessage> Run(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] GridEvent <JObject>[] gridEvents,
            [Table(nameof(Collections.Events), Connection = AppSettingContainingConnectionString)] CloudTable eventsTable,
            [Inject(typeof(IStorageFactory <EventHistoryTableEntity>))] IStorageFactory <EventHistoryTableEntity> storageFactory,
            ILogger logger)
        {
            var eventProcessor = new EventHistoryProcessor(gridEvents, storageFactory.Create(eventsTable), logger);

            return(await ProcessorRunner.Run(eventProcessor));
        }
Пример #2
0
        public static async Task <HttpResponseMessage> Run(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] GridEvent <StorageEvent>[] gridEvents,
            [Table(nameof(Collections.AccountsV1), Connection = AppSettingContainingConnectionString)] CloudTable accountsV1,
            [Table(nameof(Collections.UsersV1), Connection = AppSettingContainingConnectionString)] CloudTable UsersV1,
            [Table(nameof(Collections.ContactsV1), Connection = AppSettingContainingConnectionString)] CloudTable contactsV1,
            [Inject(typeof(IStorageFactory <StorageEventTableEntity>))] IStorageFactory <StorageEventTableEntity> storageFactory,
            ILogger logger)
        {
            var storageTables = new Dictionary <string, IStorage <StorageEventTableEntity> >
            {
                { Collections.AccountsV1, storageFactory.Create(accountsV1) },
                { Collections.UsersV1, storageFactory.Create(UsersV1) },
                { Collections.ContactsV1, storageFactory.Create(contactsV1) },
            };

            var eventProcessor = new StorageEventProcessor(gridEvents, storageTables, logger);

            return(await ProcessorRunner.Run(eventProcessor));
        }