public CategoryRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public AwardDefinitionRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public SearchRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public UserRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory) { _cacheHelper = cacheHelper; _sqlObjectFactory = sqlObjectFactory; }
public UserAwardRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public PointLedgerRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public AwardCalculationQueueRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public SearchRepository(ISqlObjectFactory sqlObjectFactory, IConfig config, IErrorLog errorLog, ITopicRepository topicRepository) : base(sqlObjectFactory) { _config = config; _errorLog = errorLog; _topicRepository = topicRepository; }
public FavoriteTopicsRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public PrivateMessageRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory) { _cacheHelper = cacheHelper; _sqlObjectFactory = sqlObjectFactory; }
public BanRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public AwardConditionRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public ExternalUserAssociationRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public SearchRepository(ISqlObjectFactory sqlObjectFactory, ITopicRepository topicRepository, IElasticSearchClientWrapper elasticSearchClientWrapper) : base(sqlObjectFactory) { _topicRepository = topicRepository; _elasticSearchClientWrapper = elasticSearchClientWrapper; }
public TopicRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
private void Build_InsertStatement( ISqlObjectFactory factory, SqlContainer sqlContainer, ISqlCommand sqlCommand, StringBuilder commandText, int?commandCount) { var tableBracket = TableBracket; switch (TableType) { case Sqls.TableTypes.History: tableBracket = HistoryTableBracket; break; case Sqls.TableTypes.Deleted: tableBracket = DeletedTableBracket; break; } var columnNameCollection = new List <string>(); var valueCollection = new List <string>(); if (AddUpdatorParam) { columnNameCollection.Add("\"Creator\""); columnNameCollection.Add("\"Updator\""); valueCollection.Add($"{Parameters.Parameter.SqlParameterPrefix}U"); valueCollection.Add($"{Parameters.Parameter.SqlParameterPrefix}U"); } SqlParamCollection? .Where(o => o.Using) .ForEach(sqlParam => { columnNameCollection.Add(sqlParam.ColumnBracket); if (!sqlParam.Raw.IsNullOrEmpty()) { switch (sqlParam.Raw?.ToString()) { case "@@identity": valueCollection.Add($"{Parameters.Parameter.SqlParameterPrefix}I"); break; default: valueCollection.Add(sqlParam.Raw); break; } } else if (sqlParam.Sub != null) { valueCollection.Add("(" + sqlParam.Sub.GetCommandText( factory: factory, sqlContainer: sqlContainer, sqlCommand: sqlCommand, prefix: "_sub", commandCount: commandCount) + ")"); } else { valueCollection.Add("@" + sqlParam.VariableName + commandCount .ToString()); } }); commandText.Append( "insert into ", tableBracket, "(", columnNameCollection.Join(), ") ", Values( factory: factory, valueCollection: valueCollection, sqlContainer: sqlContainer, sqlCommand: sqlCommand, commandCount: commandCount)); }
public TopicRepository(ISqlObjectFactory sqlObjectFactory, ICacheHelper cache) { _sqlObjectFactory = sqlObjectFactory; _cache = cache; }
public QueuedEmailMessageRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public SubscribedTopicsRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public ModerationLogRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public UserSessionRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory) { _cacheHelper = cacheHelper; _sqlObjectFactory = sqlObjectFactory; }
public PostRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public SearchIndexQueueRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public EventDefinitionRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public LastReadRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public SetupRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
protected void AddParams_Where(ISqlObjectFactory factory, ISqlCommand sqlCommand, int?commandCount) { AddParams_Where(factory, sqlCommand, SqlWhereCollection, commandCount); }
protected void AddParams_Having(ISqlObjectFactory factory, ISqlCommand sqlCommand, int?commandCount) { AddParams_Having(factory, sqlCommand, SqlHavingCollection, commandCount); }
public FeedRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public ForumRepository(ICacheHelper cacheHelper, ISqlObjectFactory sqlObjectFactory) { _cacheHelper = cacheHelper; _sqlObjectFactory = sqlObjectFactory; }
public UserImageRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public ErrorLogRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
public SecurityLogRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
private void Build_UpdateStatement( ISqlObjectFactory factory, SqlContainer sqlContainer, ISqlCommand sqlCommand, StringBuilder commandText, int?commandCount) { var tableBracket = TableBracket; switch (TableType) { case Sqls.TableTypes.History: tableBracket = HistoryTableBracket; break; case Sqls.TableTypes.Deleted: tableBracket = DeletedTableBracket; break; } var columnNameCollection = new List <string>(); if (AddUpdatorParam) { columnNameCollection.Add($"\"Updator\" = {Parameters.Parameter.SqlParameterPrefix}U"); } if (AddUpdatedTimeParam) { columnNameCollection.Add($"\"UpdatedTime\" = {factory.Sqls.CurrentDateTime} "); } SqlParamCollection? .Where(o => (o as SqlParam).Using) .Where(o => (o as SqlParam).Updating) .ForEach(sqlParam => { if (!sqlParam.Raw.IsNullOrEmpty()) { switch (sqlParam.Raw?.ToString()) { case "@@identity": columnNameCollection.Add( sqlParam.ColumnBracket + $"={Parameters.Parameter.SqlParameterPrefix}I"); break; default: columnNameCollection.Add( sqlParam.ColumnBracket + "=" + sqlParam.Raw .Replace("#CommandCount#", commandCount.ToString())); break; } } else if (sqlParam.Sub != null) { columnNameCollection.Add(sqlParam.ColumnBracket + "=(" + sqlParam.Sub.GetCommandText( factory: factory, sqlContainer: sqlContainer, sqlCommand: sqlCommand, prefix: "_sub", commandCount: commandCount) + ")"); } else if (!sqlParam.ColumnBracket.IsNullOrEmpty()) { columnNameCollection.Add( sqlParam.ColumnBracket + "=@" + sqlParam.VariableName + commandCount); } }); commandText.Append("update ", tableBracket, " set ", columnNameCollection.Join(), " "); }
public ServiceHeartbeatRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }
private static void General( ISqlObjectFactory factory, string generalTableName, string sourceTableName, List <IndexInfo> tableIndexCollection) { if (Def.ColumnDefinitionCollection.Any(o => o.TableName == generalTableName && o.Pk > 0)) { tableIndexCollection.Add(new IndexInfo( factory: factory, tableName: sourceTableName, type: IndexInfo.Types.Pk, name: "Pk", columnCollection: Def.ColumnDefinitionCollection .Where(o => o.TableName == generalTableName) .Where(o => o.Pk > 0) .OrderBy(o => o.Pk) .Select(o => new IndexInfo.Column( o.ColumnName, o.Pk, o.PkOrderBy)) .ToList())); } if (Def.ColumnDefinitionCollection.Any(o => o.TableName == generalTableName && o.Ix1 > 0)) { tableIndexCollection.Add(new IndexInfo( factory: factory, tableName: sourceTableName, type: IndexInfo.Types.Ix, name: "Ix1", columnCollection: Def.ColumnDefinitionCollection .Where(o => o.TableName == generalTableName) .Where(o => o.Ix1 > 0) .OrderBy(o => o.Ix1) .Select(o => new IndexInfo.Column(o.ColumnName, o.Ix1, o.Ix1OrderBy, o.Unique)) .ToList())); } if (Def.ColumnDefinitionCollection.Any(o => o.TableName == generalTableName && o.Ix2 > 0)) { tableIndexCollection.Add(new IndexInfo( factory: factory, tableName: sourceTableName, type: IndexInfo.Types.Ix, name: "Ix2", columnCollection: Def.ColumnDefinitionCollection .Where(o => o.TableName == generalTableName) .Where(o => o.Ix2 > 0) .OrderBy(o => o.Ix2) .Select(o => new IndexInfo.Column(o.ColumnName, o.Ix2, o.Ix2OrderBy, o.Unique)) .ToList())); } if (Def.ColumnDefinitionCollection.Any(o => o.TableName == generalTableName && o.Ix3 > 0)) { tableIndexCollection.Add(new IndexInfo( factory: factory, tableName: sourceTableName, type: IndexInfo.Types.Ix, name: "Ix3", columnCollection: Def.ColumnDefinitionCollection .Where(o => o.TableName == generalTableName) .Where(o => o.Ix3 > 0) .OrderBy(o => o.Ix3) .Select(o => new IndexInfo.Column(o.ColumnName, o.Ix3, o.Ix3OrderBy, o.Unique)) .ToList())); } }
public UserAvatarRepository(ISqlObjectFactory sqlObjectFactory) { _sqlObjectFactory = sqlObjectFactory; }