public InitialDataSeeder(IApplicationWriteDbContext context, IApplicationWriteDbFacade facade, ILogger logger, IViewModelToDbEntityMapper <TenantViewModel, TenantEntity> tenantViewModelToDbEntityMapper) { this.context = context ?? throw new ArgumentNullException(nameof(context)); this.facade = facade ?? throw new ArgumentNullException(nameof(facade)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.tenantViewModelToDbEntityMapper = tenantViewModelToDbEntityMapper ?? throw new ArgumentNullException(nameof(tenantViewModelToDbEntityMapper)); }
public AddOrUpdateTenantCommandHandler( IApplicationWriteDbContext context, IApplicationWriteDbFacade facade, IViewModelToDbEntityMapper <TenantViewModel, TenantEntity> mapper) { this.context = context ?? throw new ArgumentNullException(nameof(context)); this.facade = facade ?? throw new ArgumentNullException(nameof(facade)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public static string[] GetTenantTables(this IApplicationWriteDbFacade facade) { var tenantTables = (from prop in typeof(IApplicationWriteDbContext).GetProperties() where prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition() == typeof(DbSet <>) && prop.PropertyType.GetGenericArguments()[0].GetProperties().Any(p => p.Name == "TenantId") select prop.Name).ToArray(); return((from t in tablesOrderedByRelation where tenantTables.Contains(t) select t).ToArray()); }
public SubmitNewPaidTimeOffRequestCommandHandler( IApplicationWriteDbContext context, IApplicationWriteDbFacade facade, PaidTimeOffRequestService paidTimeOffRequestService, IModelMapper mapper) { this.context = context ?? throw new ArgumentNullException(nameof(context)); this.facade = facade ?? throw new ArgumentNullException(nameof(facade)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); this.paidTimeOffRequestService = paidTimeOffRequestService ?? throw new ArgumentNullException(nameof(paidTimeOffRequestService)); }
public SeedInitialDataCommandHandler( IApplicationWriteDbContext context, IApplicationWriteDbFacade queryFacade, ILogger <SeedInitialDataCommandHandler> logger, IViewModelToDbEntityMapper <TenantViewModel, TenantEntity> tenantViewModelToDbEntityMapper) { this.context = context ?? throw new ArgumentNullException(nameof(context)); this.queryFacade = queryFacade ?? throw new ArgumentNullException(nameof(queryFacade)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.tenantViewModelToDbEntityMapper = tenantViewModelToDbEntityMapper ?? throw new ArgumentNullException(nameof(tenantViewModelToDbEntityMapper)); }
public DummyDataInserter(IApplicationWriteDbContext context, IApplicationWriteDbFacade facade) { this.context = context ?? throw new ArgumentNullException(nameof(context)); this.facade = facade ?? throw new ArgumentNullException(nameof(facade)); }
public ClearAndReinitializeAllDataCommandHandler(IApplicationWriteDbFacade queryFacade) { this.queryFacade = queryFacade ?? throw new ArgumentNullException(nameof(queryFacade)); }
public ClearTablesCommandHandler(IApplicationWriteDbFacade facade) { this.facade = facade ?? throw new ArgumentNullException(nameof(facade)); }
public static Task TurnOnIdentityIncrementAsync(this IApplicationWriteDbFacade facade, string tableName, IDbTransaction?transaction = null) => facade.ExecuteAsync(GetIdentityIncrementStatement(tableName, false), transaction: transaction);
public static Task SetIdentitySeedForAllAspNetCoreTablesAsync(this IApplicationWriteDbFacade facade, int seedValue, IDbTransaction?transaction = null) => facade.ExecuteAsync(string.Join(Environment.NewLine, from t in aspNetCoreTablesOrderedByRelation select GetReseedStatement(t, seedValue)), transaction: transaction);
public static Task SetIdentitySeedAsync(this IApplicationWriteDbFacade facade, string tableName, int seedValue, IDbTransaction?transaction = null) => facade.ExecuteAsync(GetReseedStatement(tableName, seedValue), transaction: transaction);
public static Task ClearAllTablesAsync(this IApplicationWriteDbFacade facade, IDbTransaction?transaction = null) => facade.ExecuteAsync(string.Join(Environment.NewLine, from t in tablesOrderedByRelation select GetDeleteStatement(t)), transaction: transaction);
public DeleteTenantCommandHandler(IApplicationWriteDbFacade facade, IApplicationWriteDbContext context) { this.facade = facade ?? throw new ArgumentNullException(nameof(facade)); this.context = context ?? throw new ArgumentNullException(nameof(context)); }