public static async Task <AggregateConfig> GetAggregatesAsync <TEntity>(IQueryable <TEntity> result, IAggregateConfig <AggregateColumn> config) { var resultConfig = new AggregateConfig(config); foreach (var column in resultConfig.Columns) { await SetAggregateAsync(result, column) .ConfigureAwait(false); } return(resultConfig); }
protected virtual Task CreateSnapShotCollectionIfNotExistsAsync(AggregateConfig config) { return(CreateCollectionAsync(SnapshotCollectionName(config.AggregateType), config.SnapshotOfferThroughput)); }
protected virtual Task CreateAggregateCollectionIfNotExistsAsync(AggregateConfig config) { return(CreateCollectionAsync(config.AggregateType.Name, config.OfferThroughput)); }
protected virtual Task CreateSnapshotTableForAggregateAsync(IDbConnection connection, AggregateConfig aggregateConfig) { var aggregateTable = string.Format(@"IF OBJECT_ID (N'{0}', N'U') IS NOT NULL DROP TABLE [{1}].[{0}] CREATE TABLE [{1}].[{0}]( [Id] UNIQUEIDENTIFIER NOT NULL, [AggregateId] UNIQUEIDENTIFIER NOT NULL, [ClrType] NVARCHAR (500) NOT NULL, [AggregateVersion] INT NOT NULL, [TimeStamp] DATETIME2 (7) NOT NULL, [Data] NVARCHAR (MAX) NOT NULL PRIMARY KEY (AggregateId,[Id]))" , SnapshotTableName(aggregateConfig.AggregateType), _config.Schema); return(connection.ExecuteAsync(aggregateTable)); }
public static AggregateConfig BindCarter(this AggregateConfig config) { config.Merge(new CarterComandHandlerSliceStartup()); return(config); }