Class CommonUtils
Inheritance
System.Object
CommonUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: FreeSql.dll
Syntax
public abstract class CommonUtils
Constructors
|
Improve this Doc
View Source
CommonUtils(IFreeSql)
Declaration
public CommonUtils(IFreeSql orm)
Parameters
| Type |
Name |
Description |
| IFreeSql |
orm |
|
Fields
|
Improve this Doc
View Source
_mappingPriorityTypes
Declaration
public MappingPriorityType[] _mappingPriorityTypes
Field Value
|
Improve this Doc
View Source
dbTablesLock
Declaration
public object dbTablesLock
Field Value
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
IsQuoteSqlName
Declaration
public bool IsQuoteSqlName
Field Value
| Type |
Description |
| System.Boolean |
|
Properties
|
Improve this Doc
View Source
_orm
Declaration
public IFreeSql _orm { get; set; }
Property Value
| Type |
Description |
| IFreeSql |
|
|
Improve this Doc
View Source
CodeFirst
Declaration
public ICodeFirst CodeFirst { get; }
Property Value
|
Improve this Doc
View Source
dbTables
Declaration
public List<DbTableInfo> dbTables { get; set; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<DbTableInfo> |
|
|
Improve this Doc
View Source
Now
Declaration
public abstract string Now { get; }
Property Value
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
NowUtc
Declaration
public abstract string NowUtc { get; }
Property Value
| Type |
Description |
| System.String |
|
Methods
|
Improve this Doc
View Source
AppendParamter(List<DbParameter>, String, ColumnInfo, Type, Object)
Declaration
public abstract DbParameter AppendParamter(List<DbParameter> _params, string parameterName, ColumnInfo col, Type type, object value)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<System.Data.Common.DbParameter> |
_params |
|
| System.String |
parameterName |
|
| ColumnInfo |
col |
|
| System.Type |
type |
|
| System.Object |
value |
|
Returns
| Type |
Description |
| System.Data.Common.DbParameter |
|
|
Improve this Doc
View Source
BitAnd(String, String)
Declaration
public virtual string BitAnd(string left, string right)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
| System.String |
right |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
BitNot(String)
Declaration
public virtual string BitNot(string left)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
BitOr(String, String)
Declaration
public virtual string BitOr(string left, string right)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
| System.String |
right |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
BitShiftLeft(String, String)
Declaration
public virtual string BitShiftLeft(string left, string right)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
| System.String |
right |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
BitShiftRight(String, String)
Declaration
public virtual string BitShiftRight(string left, string right)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
| System.String |
right |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
BitXor(String, String)
Declaration
public virtual string BitXor(string left, string right)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
| System.String |
right |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
BytesSqlRaw(Byte[])
Declaration
public static string BytesSqlRaw(byte[] bytes)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
bytes |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
ConfigEntity(Type, Action<TableFluent>)
Declaration
public ICodeFirst ConfigEntity(Type type, Action<TableFluent> entity)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.Action<TableFluent> |
entity |
|
Returns
|
Improve this Doc
View Source
ConfigEntity<T>(Action<TableFluent<T>>)
Declaration
public ICodeFirst ConfigEntity<T>(Action<TableFluent<T>> entity)
Parameters
| Type |
Name |
Description |
| System.Action<TableFluent<T>> |
entity |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Div(String, String, Type, Type)
Declaration
public abstract string Div(string left, string right, Type leftType, Type rightType)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
| System.String |
right |
|
| System.Type |
leftType |
|
| System.Type |
rightType |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
FieldAsAlias(String)
Declaration
public virtual string FieldAsAlias(string alias)
Parameters
| Type |
Name |
Description |
| System.String |
alias |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Declaration
public abstract string FormatSql(string sql, params object[] args)
Parameters
| Type |
Name |
Description |
| System.String |
sql |
|
| System.Object[] |
args |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
GetConfigEntity(Type)
Declaration
public TableAttribute GetConfigEntity(Type type)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
Returns
|
Improve this Doc
View Source
GetDbParamtersByObject(String, Object)
Declaration
public abstract DbParameter[] GetDbParamtersByObject(string sql, object obj)
Parameters
| Type |
Name |
Description |
| System.String |
sql |
|
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Data.Common.DbParameter[] |
|
|
Improve this Doc
View Source
GetEntityColumnAttribute(Type, PropertyInfo)
Declaration
public ColumnAttribute GetEntityColumnAttribute(Type type, PropertyInfo proto)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.Reflection.PropertyInfo |
proto |
|
Returns
|
Improve this Doc
View Source
GetEntityIndexAttribute(Type)
Declaration
public IndexAttribute[] GetEntityIndexAttribute(Type type)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
Returns
|
Improve this Doc
View Source
GetEntityNavigateAttribute(Type, PropertyInfo)
Declaration
public NavigateAttribute GetEntityNavigateAttribute(Type type, PropertyInfo proto)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.Reflection.PropertyInfo |
proto |
|
Returns
|
Improve this Doc
View Source
GetEntityTableAttribute(Type)
Declaration
public TableAttribute GetEntityTableAttribute(Type type)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
Returns
|
Improve this Doc
View Source
GetNoneParamaterSqlValue(List<DbParameter>, String, ColumnInfo, Type, Object)
Declaration
public abstract string GetNoneParamaterSqlValue(List<DbParameter> specialParams, string specialParamFlag, ColumnInfo col, Type type, object value)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<System.Data.Common.DbParameter> |
specialParams |
|
| System.String |
specialParamFlag |
|
| ColumnInfo |
col |
|
| System.Type |
type |
|
| System.Object |
value |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
动态读取 DescriptionAttribute 注释文本
Declaration
public static Dictionary<string, string> GetPropertyCommentByDescriptionAttribute(Type type)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
Returns
| Type |
Description |
| System.Collections.Generic.Dictionary<System.String, System.String> |
|
|
Improve this Doc
View Source
Declaration
public static Dictionary<string, string> GetProperyCommentBySummary(Type type)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
Returns
| Type |
Description |
| System.Collections.Generic.Dictionary<System.String, System.String> |
Dict:key=属性名,value=注释
|
|
Improve this Doc
View Source
GetSplitTableNames(String, Char, Char, Int32)
Declaration
public static string[] GetSplitTableNames(string name, char leftQuote, char rightQuote, int size)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| System.Char |
leftQuote |
|
| System.Char |
rightQuote |
|
| System.Int32 |
size |
|
Returns
| Type |
Description |
| System.String[] |
|
|
Improve this Doc
View Source
GetTableByEntity(Type)
Declaration
public TableInfo GetTableByEntity(Type entity)
Parameters
| Type |
Name |
Description |
| System.Type |
entity |
|
Returns
|
Improve this Doc
View Source
IIF(String, String, String)
Declaration
public virtual string IIF(string test, string ifTrue, string ifElse)
Parameters
| Type |
Name |
Description |
| System.String |
test |
|
| System.String |
ifTrue |
|
| System.String |
ifElse |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
IsNull(String, Object)
Declaration
public abstract string IsNull(string sql, object value)
Parameters
| Type |
Name |
Description |
| System.String |
sql |
|
| System.Object |
value |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Mod(String, String, Type, Type)
Declaration
public abstract string Mod(string left, string right, Type leftType, Type rightType)
Parameters
| Type |
Name |
Description |
| System.String |
left |
|
| System.String |
right |
|
| System.Type |
leftType |
|
| System.Type |
rightType |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
PrevReheatConnectionPool(ObjectPool<DbConnection>, Int32)
Declaration
public static void PrevReheatConnectionPool(ObjectPool<DbConnection> pool, int minPoolSize)
Parameters
| Type |
Name |
Description |
| ObjectPool<System.Data.Common.DbConnection> |
pool |
|
| System.Int32 |
minPoolSize |
|
|
Improve this Doc
View Source
QuoteParamterName(String)
Declaration
public abstract string QuoteParamterName(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
QuoteReadColumnAdapter(Type, Type, String)
Declaration
protected abstract string QuoteReadColumnAdapter(Type type, Type mapType, string columnName)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.Type |
mapType |
|
| System.String |
columnName |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
QuoteSqlName(String[])
Declaration
public string QuoteSqlName(params string[] name)
Parameters
| Type |
Name |
Description |
| System.String[] |
name |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
QuoteSqlNameAdapter(String[])
Declaration
public abstract string QuoteSqlNameAdapter(params string[] name)
Parameters
| Type |
Name |
Description |
| System.String[] |
name |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
QuoteWriteParamterAdapter(Type, String)
Declaration
public abstract string QuoteWriteParamterAdapter(Type type, string paramterName)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.String |
paramterName |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
RereadColumn(ColumnInfo, String)
Declaration
public string RereadColumn(ColumnInfo col, string columnName)
Parameters
| Type |
Name |
Description |
| ColumnInfo |
col |
|
| System.String |
columnName |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
RewriteColumn(ColumnInfo, String)
Declaration
public virtual string RewriteColumn(ColumnInfo col, string sql)
Parameters
| Type |
Name |
Description |
| ColumnInfo |
col |
|
| System.String |
sql |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
SplitTableName(String)
Declaration
public abstract string[] SplitTableName(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.String[] |
|
|
Improve this Doc
View Source
StringConcat(String[], Type[])
Declaration
public abstract string StringConcat(string[] objs, Type[] types)
Parameters
| Type |
Name |
Description |
| System.String[] |
objs |
|
| System.Type[] |
types |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
TrimQuoteSqlName(String)
Declaration
public abstract string TrimQuoteSqlName(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
WhereItems<TEntity>(ColumnInfo[], String, IEnumerable<TEntity>)
Declaration
public string WhereItems<TEntity>(ColumnInfo[] primarys, string aliasAndDot, IEnumerable<TEntity> items)
Parameters
| Type |
Name |
Description |
| ColumnInfo[] |
primarys |
|
| System.String |
aliasAndDot |
|
| System.Collections.Generic.IEnumerable<TEntity> |
items |
|
Returns
| Type |
Description |
| System.String |
|
Type Parameters
|
Improve this Doc
View Source
WhereObject(TableInfo, String, Object)
Declaration
public string WhereObject(TableInfo table, string aliasAndDot, object dywhere)
Parameters
| Type |
Name |
Description |
| TableInfo |
table |
|
| System.String |
aliasAndDot |
|
| System.Object |
dywhere |
|
Returns
| Type |
Description |
| System.String |
|