private string GetTemporalTableSqlDependingOnIfTableIsTemporalOrNot <TEntity>( ITableHelper <FakeDataContext> tableHelper, params Type[] entityTypesToCreateTemporalTablesFor) where TEntity : class { var options = DbContextOptionsSetup.Setup <FakeDataContext>(); using (var context = new FakeDataContext(options)) { // Register entity types to support temporal tables. entityTypesToCreateTemporalTablesFor ?.ToList() ?.ForEach(e => TemporalEntitiesCache.Add(context.Model.FindEntityType(e))); var entityType = context.Model.FindEntityType(typeof(TEntity)); var temporalTableSqlBuilder = new TemporalTableSqlBuilder <FakeDataContext>( context, new TemporalTableSqlGeneratorFactory(), tableHelper); string sql = temporalTableSqlBuilder.BuildTemporalTablesSqlForEntityTypes(new[] { entityType }); return(sql); } }
public RegistrationService( TableHelperRegistry tableHelperRegistry, IAccountService accountService) { _accountService = accountService; _accountTableHelper = tableHelperRegistry.TableHelpers[Table.Accounts]; }
public TemporalTableSqlBuilder( TContext context, ITemporalTableSqlGeneratorFactory temporalTableSqlGeneratorFactory, ITableHelper <TContext> tableHelper) { this.context = context; this.temporalTableSqlGeneratorFactory = temporalTableSqlGeneratorFactory; this.tableHelper = tableHelper; }
public JwtRefreshTokenService( TableHelperRegistry tableHelperRegistry, IAccountService accountService, IJwtService jwtService) { _jwtService = jwtService; _accountService = accountService; _tableHelper = tableHelperRegistry.TableHelpers[Table.RefreshTokens]; }
public TemporalTablesMigrationsSqlGenerator( MigrationsSqlGeneratorDependencies dependencies, IRelationalAnnotationProvider migrationsAnnotations, ITemporalTableSqlGeneratorFactory temporalTableSqlGeneratorFactory, ITableHelper <TContext> tableHelper) : base(dependencies, migrationsAnnotations) { this.temporalTableSqlGeneratorFactory = temporalTableSqlGeneratorFactory; this.tableHelper = tableHelper; }
public ScoreService(ITableHelper tableHelper, IConfiguration configuration) { _tableHelper = tableHelper; _configuration = configuration; }
public MigrationService(ITableHelper tableHelper) { _tableHelper = tableHelper; }
public AccountService(TableHelperRegistry tableHelperRegistry) { _accountTableHelper = tableHelperRegistry.TableHelpers[Table.Accounts]; }
public WorkTimesService(TableHelperRegistry tableHelperRegistry) { _tableHelper = tableHelperRegistry.TableHelpers[Table.WorkTimes]; }