Example #1
0
 /// <summary>
 /// Initializes a new instance of <c>WhereClauseBuilderBase&lt;T&gt;</c> class.
 /// </summary>
 /// <param name="storeMapping">The <c>Apworks.Storage.IStorageMappingResolver</c>
 /// instance which will be used for generating the mapped field names.</param>
 public WhereClauseBuilder(IStoreMapping storeMapping, StorageDialectSettings dialectSettings, bool useTableAlias = false)
 {
     this.storeMapping    = storeMapping;
     this.dialectSettings = dialectSettings;
     this.useTableAlias   = useTableAlias;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityStore{TEntity, TKey}"/> class.
 /// </summary>
 /// <param name="mapping">The instance for providing the mappings for tableName/entityName and columnName/PropertyName. It can also
 /// provide the escaped names of mapped tabelName and columnName, based on the given <paramref name="dialectSettings"/>.</param>
 /// <param name="dialectSettings">The storage dialect settings to be used by the <paramref name="mapping"/> instance.</param>
 public EntityStore(IStoreMapping mapping, StorageDialectSettings dialectSettings)
 {
     this.mapping         = mapping;
     this.dialectSettings = dialectSettings;
 }
Example #3
0
 public string GetEscapedColumnName <TEntity, TKey, TProperty>(StorageDialectSettings dialectSettings, Expression <Func <TEntity, TProperty> > property)
     where TKey : IEquatable <TKey>
     where TEntity : class, IEntity <TKey>, new() =>
 $"{dialectSettings.SqlLeadingEscape}{GetColumnName<TEntity, TKey, TProperty>(property)}{dialectSettings.SqlTailingEscape}";
Example #4
0
 public string GetEscapedColumnName <TEntity, TKey>(StorageDialectSettings dialectSettings, string name)
     where TKey : IEquatable <TKey>
     where TEntity : class, IEntity <TKey>, new() =>
 $"{dialectSettings.SqlLeadingEscape}{name}{dialectSettings.SqlTailingEscape}";
Example #5
0
 public string GetEscapedTableName <TEntity, TKey>(StorageDialectSettings dialectSettings)
     where TKey : IEquatable <TKey>
     where TEntity : class, IEntity <TKey>, new() =>
 $"{dialectSettings.SqlLeadingEscape}{GetTableName<TEntity, TKey>()}{dialectSettings.SqlTailingEscape}";