OrmLiteUtils
Assembly: ServiceStack.OrmLite.dll
View Source
public static class OrmLiteUtils : object
Properties
SqlVerifyFragmentFn
View Source
public static Func<string, string> SqlVerifyFragmentFn { get; set; }
Fields
VerifyFragmentRegEx
View Source
public static Regex VerifyFragmentRegEx
VerifySqlRegEx
View Source
public static Regex VerifySqlRegEx
IllegalSqlFragmentTokens
View Source
public static string[] IllegalSqlFragmentTokens
RegexPassword
View Source
public static Regex RegexPassword
Methods
HandleException(Exception, String, Object[])
View Source
public static void HandleException(Exception ex, string message = null, params object[] args)
Parameters
Type | Name |
---|---|
Exception | ex |
System.String | message |
System.Object[] | args |
DebugCommand(ILog, IDbCommand)
View Source
public static void DebugCommand(this ILog log, IDbCommand cmd)
Parameters
Type | Name |
---|---|
ServiceStack.Logging.ILog | log |
IDbCommand | cmd |
GetDebugString(IDbCommand)
View Source
public static string GetDebugString(this IDbCommand cmd)
Returns
System.String
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CreateInstance<T>()
View Source
public static T CreateInstance<T>()
Returns
<T>
Type Parameters
T
IsScalar<T>()
View Source
public static bool IsScalar<T>()
Returns
System.Boolean
Type Parameters
T
ConvertTo<T>(IDataReader, IOrmLiteDialectProvider, HashSet<String>)
View Source
public static T ConvertTo<T>(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, HashSet<string> onlyFields = null)
Returns
<T>
Parameters
Type | Name |
---|---|
IDataReader | reader |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialectProvider |
HashSet<System.String> | onlyFields |
Type Parameters
T
ConvertToListObjects(IDataReader)
View Source
public static List<object> ConvertToListObjects(this IDataReader dataReader)
Returns
List<System.Object>
Parameters
Type | Name |
---|---|
IDataReader | dataReader |
ConvertToDictionaryObjects(IDataReader)
View Source
public static Dictionary<string, object> ConvertToDictionaryObjects(this IDataReader dataReader)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
IDataReader | dataReader |
ConvertToExpandoObject(IDataReader)
View Source
public static IDictionary<string, object> ConvertToExpandoObject(this IDataReader dataReader)
Returns
IDictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
IDataReader | dataReader |
ConvertToValueTuple<T>(IDataReader, Object[], IOrmLiteDialectProvider)
View Source
public static T ConvertToValueTuple<T>(this IDataReader reader, object[] values, IOrmLiteDialectProvider dialectProvider)
Returns
<T>
Parameters
Type | Name |
---|---|
IDataReader | reader |
System.Object[] | values |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialectProvider |
Type Parameters
T
ConvertToList<T>(IDataReader, IOrmLiteDialectProvider, HashSet<String>)
View Source
public static List<T> ConvertToList<T>(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, HashSet<string> onlyFields = null)
Returns
List<<T>>
Parameters
Type | Name |
---|---|
IDataReader | reader |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialectProvider |
HashSet<System.String> | onlyFields |
Type Parameters
T
ConvertTo(IDataReader, IOrmLiteDialectProvider, Type)
View Source
public static object ConvertTo(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
IDataReader | reader |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialectProvider |
Type | type |
ConvertToList(IDataReader, IOrmLiteDialectProvider, Type)
View Source
public static IList ConvertToList(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, Type type)
Returns
IList
Parameters
Type | Name |
---|---|
IDataReader | reader |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialectProvider |
Type | type |
GetColumnNames(ModelDefinition, IOrmLiteDialectProvider)
View Source
public static string GetColumnNames(this ModelDefinition modelDef, IOrmLiteDialectProvider dialect)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
ToSelectString<TItem>(IEnumerable<TItem>)
View Source
public static string ToSelectString<TItem>(this IEnumerable<TItem> items)
Returns
System.String
Parameters
Type | Name |
---|---|
IEnumerable<<TItem>> | items |
Type Parameters
TItem
SqlFmt(String, Object[])
View Source
public static string SqlFmt(this string sqlText, params object[] sqlParams)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sqlText |
System.Object[] | sqlParams |
SqlFmt(String, IOrmLiteDialectProvider, Object[])
View Source
public static string SqlFmt(this string sqlText, IOrmLiteDialectProvider dialect, params object[] sqlParams)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sqlText |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
System.Object[] | sqlParams |
SqlColumn(String, IOrmLiteDialectProvider)
View Source
public static string SqlColumn(this string columnName, IOrmLiteDialectProvider dialect = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | columnName |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
SqlColumnRaw(String, IOrmLiteDialectProvider)
View Source
public static string SqlColumnRaw(this string columnName, IOrmLiteDialectProvider dialect = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | columnName |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
SqlTable(String, IOrmLiteDialectProvider)
View Source
public static string SqlTable(this string tableName, IOrmLiteDialectProvider dialect = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | tableName |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
SqlTableRaw(String, IOrmLiteDialectProvider)
View Source
public static string SqlTableRaw(this string tableName, IOrmLiteDialectProvider dialect = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | tableName |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
SqlValue(Object)
View Source
public static string SqlValue(this object value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
isUnsafeSql(String, Regex)
View Source
public static bool isUnsafeSql(string sql, Regex verifySql)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | sql |
Regex | verifySql |
SqlVerifyFragment(String)
View Source
public static string SqlVerifyFragment(this string sqlFragment)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sqlFragment |
SqlVerifyFragment(String, IEnumerable<String>)
View Source
public static string SqlVerifyFragment(this string sqlFragment, IEnumerable<string> illegalFragments)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sqlFragment |
IEnumerable<System.String> | illegalFragments |
SqlParam(String)
View Source
public static string SqlParam(this string paramValue)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | paramValue |
StripQuotedStrings(String, Char)
View Source
public static string StripQuotedStrings(this string text, char quote = '\'')
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | text |
System.Char | quote |
SqlJoin<T>(List<T>, IOrmLiteDialectProvider)
View Source
public static string SqlJoin<T>(this List<T> values, IOrmLiteDialectProvider dialect = null)
Returns
System.String
Parameters
Type | Name |
---|---|
List<<T>> | values |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
Type Parameters
T
SqlJoin(IEnumerable, IOrmLiteDialectProvider)
View Source
public static string SqlJoin(IEnumerable values, IOrmLiteDialectProvider dialect = null)
Returns
System.String
Parameters
Type | Name |
---|---|
IEnumerable | values |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
SqlInValues<T>(T[], IOrmLiteDialectProvider)
View Source
public static SqlInValues SqlInValues<T>(this T[] values, IOrmLiteDialectProvider dialect = null)
Returns
ServiceStack.OrmLite.SqlInValues
Parameters
Type | Name |
---|---|
<T>[] | values |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
Type Parameters
T
SqlInParams<T>(T[], IOrmLiteDialectProvider)
View Source
public static string SqlInParams<T>(this T[] values, IOrmLiteDialectProvider dialect = null)
Returns
System.String
Parameters
Type | Name |
---|---|
<T>[] | values |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
Type Parameters
T
GetIndexFieldsCache(IDataReader, ModelDefinition, IOrmLiteDialectProvider, HashSet<String>, Int32, Nullable<Int32>)
View Source
public static Tuple<FieldDefinition, int, IOrmLiteConverter>[] GetIndexFieldsCache(this IDataReader reader, ModelDefinition modelDefinition, IOrmLiteDialectProvider dialect, HashSet<string> onlyFields = null, int startPos = 0, int? endPos = null)
Returns
Tuple<ServiceStack.OrmLite.FieldDefinition,System.Int32,ServiceStack.OrmLite.IOrmLiteConverter>[]
Parameters
Type | Name |
---|---|
IDataReader | reader |
ServiceStack.OrmLite.ModelDefinition | modelDefinition |
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
HashSet<System.String> | onlyFields |
System.Int32 | startPos |
System.Nullable<System.Int32> | endPos |
IsRefType(Type)
View Source
public static bool IsRefType(this Type fieldType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
Type | fieldType |
StripTablePrefixes(String)
View Source
public static string StripTablePrefixes(this string selectExpression)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | selectExpression |
AliasOrColumn(String)
View Source
public static string AliasOrColumn(this string quotedExpr)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | quotedExpr |
StripDbQuotes(String)
View Source
public static string StripDbQuotes(this string quotedExpr)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | quotedExpr |
PrintSql()
View Source
public static void PrintSql()
UnPrintSql()
View Source
public static void UnPrintSql()
CaptureSql()
View Source
public static StringBuilder CaptureSql()
Returns
StringBuilder
CaptureSql(StringBuilder)
View Source
public static void CaptureSql(StringBuilder sb)
Parameters
Type | Name |
---|---|
StringBuilder | sb |
UnCaptureSql()
View Source
public static void UnCaptureSql()
UnCaptureSqlAndFree(StringBuilder)
View Source
public static string UnCaptureSqlAndFree(StringBuilder sb)
Returns
System.String
Parameters
Type | Name |
---|---|
StringBuilder | sb |
GetModelDefinition(Type)
View Source
public static ModelDefinition GetModelDefinition(Type modelType)
Returns
ServiceStack.OrmLite.ModelDefinition
Parameters
Type | Name |
---|---|
Type | modelType |
ConvertToULong(Byte[])
View Source
public static ulong ConvertToULong(byte[] bytes)
Returns
System.UInt64
Parameters
Type | Name |
---|---|
System.Byte[] | bytes |
Merge<Parent, Child>(Parent, List<Child>)
View Source
public static List<Parent> Merge<Parent, Child>(this Parent parent, List<Child> children)
Returns
List<<Parent>>
Parameters
Type | Name |
---|---|
<Parent> | parent |
List<<Child>> | children |
Type Parameters
Parent
Child
Merge<Parent, Child>(List<Parent>, List<Child>)
View Source
public static List<Parent> Merge<Parent, Child>(this List<Parent> parents, List<Child> children)
Returns
List<<Parent>>
Parameters
Type | Name |
---|---|
List<<Parent>> | parents |
List<<Child>> | children |
Type Parameters
Parent
Child
GetNonDefaultValueInsertFields<T>(T)
View Source
public static List<string> GetNonDefaultValueInsertFields<T>(T obj)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
<T> | obj |
Type Parameters
T
AssertNotAnonType<T>()
View Source
public static void AssertNotAnonType<T>()
Type Parameters
T
GetNonDefaultValueInsertFields<T>(IOrmLiteDialectProvider, Object)
View Source
public static List<string> GetNonDefaultValueInsertFields<T>(this IOrmLiteDialectProvider dialectProvider, object obj)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialectProvider |
System.Object | obj |
Type Parameters
T
ParseTokens(String)
View Source
public static List<string> ParseTokens(this string expr)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
System.String | expr |
AllAnonFields(Type)
View Source
public static string[] AllAnonFields(this Type type)
Returns
System.String[]
Parameters
Type | Name |
---|---|
Type | type |
EvalFactoryFn<T>(Expression<Func<T>>)
View Source
public static T EvalFactoryFn<T>(this Expression<Func<T>> expr)
Returns
<T>
Parameters
Type | Name |
---|---|
Expression<Func<<T>>> | expr |
Type Parameters
T
JoinAlias(String)
View Source
public static JoinFormatDelegate JoinAlias(string alias)
Returns
ServiceStack.OrmLite.JoinFormatDelegate
Parameters
Type | Name |
---|---|
System.String | alias |
QuotedLiteral(String)
RDBMS Quoted string 'literal'
View Source
public static string QuotedLiteral(string text)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | text |
UnquotedColumnName(String)
View Source
public static string UnquotedColumnName(string columnExpr)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | columnExpr |
OrderByFields(IOrmLiteDialectProvider, String)
View Source
public static string OrderByFields(IOrmLiteDialectProvider dialect, string orderBy)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.IOrmLiteDialectProvider | dialect |
System.String | orderBy |
MaskPassword(String)
View Source
public static string MaskPassword(string connectionString)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | connectionString |