Skip to main content

OrmLiteUtils

Assembly: ServiceStack.OrmLite.dll
View Source
Declaration
public static class OrmLiteUtils : object

Properties

SqlVerifyFragmentFn

View Source
Declaration
public static Func<string, string> SqlVerifyFragmentFn { get; set; }

Fields

VerifyFragmentRegEx

View Source
Declaration
public static Regex VerifyFragmentRegEx

VerifySqlRegEx

View Source
Declaration
public static Regex VerifySqlRegEx

IllegalSqlFragmentTokens

View Source
Declaration
public static string[] IllegalSqlFragmentTokens

RegexPassword

View Source
Declaration
public static Regex RegexPassword

Methods

HandleException(Exception, String, Object[])

View Source
Declaration
public static void HandleException(Exception ex, string message = null, params object[] args)
Parameters
TypeName
Exceptionex
System.Stringmessage
System.Object[]args

DebugCommand(ILog, IDbCommand)

View Source
Declaration
public static void DebugCommand(this ILog log, IDbCommand cmd)
Parameters
TypeName
ServiceStack.Logging.ILoglog
IDbCommandcmd

GetDebugString(IDbCommand)

View Source
Declaration
public static string GetDebugString(this IDbCommand cmd)
Returns

System.String

Parameters
TypeName
IDbCommandcmd

CreateInstance<T>()

View Source
Declaration
public static T CreateInstance<T>()
Returns

<T>

Type Parameters
  • T

IsScalar<T>()

View Source
Declaration
public static bool IsScalar<T>()
Returns

System.Boolean

Type Parameters
  • T

ConvertTo<T>(IDataReader, IOrmLiteDialectProvider, HashSet<String>)

View Source
Declaration
public static T ConvertTo<T>(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, HashSet<string> onlyFields = null)
Returns

<T>

Parameters
TypeName
IDataReaderreader
ServiceStack.OrmLite.IOrmLiteDialectProviderdialectProvider
HashSet<System.String>onlyFields
Type Parameters
  • T

ConvertToListObjects(IDataReader)

View Source
Declaration
public static List<object> ConvertToListObjects(this IDataReader dataReader)
Returns

List<System.Object>

Parameters
TypeName
IDataReaderdataReader

ConvertToDictionaryObjects(IDataReader)

View Source
Declaration
public static Dictionary<string, object> ConvertToDictionaryObjects(this IDataReader dataReader)
Returns

Dictionary<System.String,System.Object>

Parameters
TypeName
IDataReaderdataReader

ConvertToExpandoObject(IDataReader)

View Source
Declaration
public static IDictionary<string, object> ConvertToExpandoObject(this IDataReader dataReader)
Returns

IDictionary<System.String,System.Object>

Parameters
TypeName
IDataReaderdataReader

ConvertToValueTuple<T>(IDataReader, Object[], IOrmLiteDialectProvider)

View Source
Declaration
public static T ConvertToValueTuple<T>(this IDataReader reader, object[] values, IOrmLiteDialectProvider dialectProvider)
Returns

<T>

Parameters
TypeName
IDataReaderreader
System.Object[]values
ServiceStack.OrmLite.IOrmLiteDialectProviderdialectProvider
Type Parameters
  • T

ConvertToList<T>(IDataReader, IOrmLiteDialectProvider, HashSet<String>)

View Source
Declaration
public static List<T> ConvertToList<T>(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, HashSet<string> onlyFields = null)
Returns

List<<T>>

Parameters
TypeName
IDataReaderreader
ServiceStack.OrmLite.IOrmLiteDialectProviderdialectProvider
HashSet<System.String>onlyFields
Type Parameters
  • T

ConvertTo(IDataReader, IOrmLiteDialectProvider, Type)

View Source
Declaration
public static object ConvertTo(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, Type type)
Returns

System.Object

Parameters
TypeName
IDataReaderreader
ServiceStack.OrmLite.IOrmLiteDialectProviderdialectProvider
Typetype

ConvertToList(IDataReader, IOrmLiteDialectProvider, Type)

View Source
Declaration
public static IList ConvertToList(this IDataReader reader, IOrmLiteDialectProvider dialectProvider, Type type)
Returns

IList

Parameters
TypeName
IDataReaderreader
ServiceStack.OrmLite.IOrmLiteDialectProviderdialectProvider
Typetype

GetColumnNames(ModelDefinition, IOrmLiteDialectProvider)

View Source
Declaration
public static string GetColumnNames(this ModelDefinition modelDef, IOrmLiteDialectProvider dialect)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect

ToSelectString<TItem>(IEnumerable<TItem>)

View Source
Declaration
public static string ToSelectString<TItem>(this IEnumerable<TItem> items)
Returns

System.String

Parameters
TypeName
IEnumerable<<TItem>>items
Type Parameters
  • TItem

SqlFmt(String, Object[])

View Source
Declaration
public static string SqlFmt(this string sqlText, params object[] sqlParams)
Returns

System.String

Parameters
TypeName
System.StringsqlText
System.Object[]sqlParams

SqlFmt(String, IOrmLiteDialectProvider, Object[])

View Source
Declaration
public static string SqlFmt(this string sqlText, IOrmLiteDialectProvider dialect, params object[] sqlParams)
Returns

System.String

Parameters
TypeName
System.StringsqlText
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect
System.Object[]sqlParams

SqlColumn(String, IOrmLiteDialectProvider)

View Source
Declaration
public static string SqlColumn(this string columnName, IOrmLiteDialectProvider dialect = null)
Returns

System.String

Parameters
TypeName
System.StringcolumnName
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect

SqlColumnRaw(String, IOrmLiteDialectProvider)

View Source
Declaration
public static string SqlColumnRaw(this string columnName, IOrmLiteDialectProvider dialect = null)
Returns

System.String

Parameters
TypeName
System.StringcolumnName
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect

SqlTable(String, IOrmLiteDialectProvider)

View Source
Declaration
public static string SqlTable(this string tableName, IOrmLiteDialectProvider dialect = null)
Returns

System.String

Parameters
TypeName
System.StringtableName
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect

SqlTableRaw(String, IOrmLiteDialectProvider)

View Source
Declaration
public static string SqlTableRaw(this string tableName, IOrmLiteDialectProvider dialect = null)
Returns

System.String

Parameters
TypeName
System.StringtableName
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect

SqlValue(Object)

View Source
Declaration
public static string SqlValue(this object value)
Returns

System.String

Parameters
TypeName
System.Objectvalue

isUnsafeSql(String, Regex)

View Source
Declaration
public static bool isUnsafeSql(string sql, Regex verifySql)
Returns

System.Boolean

Parameters
TypeName
System.Stringsql
RegexverifySql

SqlVerifyFragment(String)

View Source
Declaration
public static string SqlVerifyFragment(this string sqlFragment)
Returns

System.String

Parameters
TypeName
System.StringsqlFragment

SqlVerifyFragment(String, IEnumerable<String>)

View Source
Declaration
public static string SqlVerifyFragment(this string sqlFragment, IEnumerable<string> illegalFragments)
Returns

System.String

Parameters
TypeName
System.StringsqlFragment
IEnumerable<System.String>illegalFragments

SqlParam(String)

View Source
Declaration
public static string SqlParam(this string paramValue)
Returns

System.String

Parameters
TypeName
System.StringparamValue

StripQuotedStrings(String, Char)

View Source
Declaration
public static string StripQuotedStrings(this string text, char quote = '\'')
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Charquote

SqlJoin<T>(List<T>, IOrmLiteDialectProvider)

View Source
Declaration
public static string SqlJoin<T>(this List<T> values, IOrmLiteDialectProvider dialect = null)
Returns

System.String

Parameters
TypeName
List<<T>>values
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect
Type Parameters
  • T

SqlJoin(IEnumerable, IOrmLiteDialectProvider)

View Source
Declaration
public static string SqlJoin(IEnumerable values, IOrmLiteDialectProvider dialect = null)
Returns

System.String

Parameters
TypeName
IEnumerablevalues
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect

SqlInValues<T>(T[], IOrmLiteDialectProvider)

View Source
Declaration
public static SqlInValues SqlInValues<T>(this T[] values, IOrmLiteDialectProvider dialect = null)
Returns

ServiceStack.OrmLite.SqlInValues

Parameters
TypeName
<T>[]values
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect
Type Parameters
  • T

SqlInParams<T>(T[], IOrmLiteDialectProvider)

View Source
Declaration
public static string SqlInParams<T>(this T[] values, IOrmLiteDialectProvider dialect = null)
Returns

System.String

Parameters
TypeName
<T>[]values
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect
Type Parameters
  • T

GetIndexFieldsCache(IDataReader, ModelDefinition, IOrmLiteDialectProvider, HashSet<String>, Int32, Nullable<Int32>)

View Source
Declaration
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
TypeName
IDataReaderreader
ServiceStack.OrmLite.ModelDefinitionmodelDefinition
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect
HashSet<System.String>onlyFields
System.Int32startPos
System.Nullable<System.Int32>endPos

IsRefType(Type)

View Source
Declaration
public static bool IsRefType(this Type fieldType)
Returns

System.Boolean

Parameters
TypeName
TypefieldType

StripTablePrefixes(String)

View Source
Declaration
public static string StripTablePrefixes(this string selectExpression)
Returns

System.String

Parameters
TypeName
System.StringselectExpression

AliasOrColumn(String)

View Source
Declaration
public static string AliasOrColumn(this string quotedExpr)
Returns

System.String

Parameters
TypeName
System.StringquotedExpr

StripDbQuotes(String)

View Source
Declaration
public static string StripDbQuotes(this string quotedExpr)
Returns

System.String

Parameters
TypeName
System.StringquotedExpr

PrintSql()

View Source
Declaration
public static void PrintSql()

UnPrintSql()

View Source
Declaration
public static void UnPrintSql()

CaptureSql()

View Source
Declaration
public static StringBuilder CaptureSql()
Returns

StringBuilder

CaptureSql(StringBuilder)

View Source
Declaration
public static void CaptureSql(StringBuilder sb)
Parameters
TypeName
StringBuildersb

UnCaptureSql()

View Source
Declaration
public static void UnCaptureSql()

UnCaptureSqlAndFree(StringBuilder)

View Source
Declaration
public static string UnCaptureSqlAndFree(StringBuilder sb)
Returns

System.String

Parameters
TypeName
StringBuildersb

GetModelDefinition(Type)

View Source
Declaration
public static ModelDefinition GetModelDefinition(Type modelType)
Returns

ServiceStack.OrmLite.ModelDefinition

Parameters
TypeName
TypemodelType

ConvertToULong(Byte[])

View Source
Declaration
public static ulong ConvertToULong(byte[] bytes)
Returns

System.UInt64

Parameters
TypeName
System.Byte[]bytes

Merge<Parent, Child>(Parent, List<Child>)

View Source
Declaration
public static List<Parent> Merge<Parent, Child>(this Parent parent, List<Child> children)
Returns

List<<Parent>>

Parameters
TypeName
<Parent>parent
List<<Child>>children
Type Parameters
  • Parent
  • Child

Merge<Parent, Child>(List<Parent>, List<Child>)

View Source
Declaration
public static List<Parent> Merge<Parent, Child>(this List<Parent> parents, List<Child> children)
Returns

List<<Parent>>

Parameters
TypeName
List<<Parent>>parents
List<<Child>>children
Type Parameters
  • Parent
  • Child

GetNonDefaultValueInsertFields<T>(T)

View Source
Declaration
public static List<string> GetNonDefaultValueInsertFields<T>(T obj)
Returns

List<System.String>

Parameters
TypeName
<T>obj
Type Parameters
  • T

AssertNotAnonType<T>()

View Source
Declaration
public static void AssertNotAnonType<T>()
Type Parameters
  • T

GetNonDefaultValueInsertFields<T>(IOrmLiteDialectProvider, Object)

View Source
Declaration
public static List<string> GetNonDefaultValueInsertFields<T>(this IOrmLiteDialectProvider dialectProvider, object obj)
Returns

List<System.String>

Parameters
TypeName
ServiceStack.OrmLite.IOrmLiteDialectProviderdialectProvider
System.Objectobj
Type Parameters
  • T

ParseTokens(String)

View Source
Declaration
public static List<string> ParseTokens(this string expr)
Returns

List<System.String>

Parameters
TypeName
System.Stringexpr

AllAnonFields(Type)

View Source
Declaration
public static string[] AllAnonFields(this Type type)
Returns

System.String[]

Parameters
TypeName
Typetype

EvalFactoryFn<T>(Expression<Func<T>>)

View Source
Declaration
public static T EvalFactoryFn<T>(this Expression<Func<T>> expr)
Returns

<T>

Parameters
TypeName
Expression<Func<<T>>>expr
Type Parameters
  • T

JoinAlias(String)

View Source
Declaration
public static JoinFormatDelegate JoinAlias(string alias)
Returns

ServiceStack.OrmLite.JoinFormatDelegate

Parameters
TypeName
System.Stringalias

QuotedLiteral(String)

RDBMS Quoted string 'literal'

View Source
Declaration
public static string QuotedLiteral(string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

UnquotedColumnName(String)

View Source
Declaration
public static string UnquotedColumnName(string columnExpr)
Returns

System.String

Parameters
TypeName
System.StringcolumnExpr

OrderByFields(IOrmLiteDialectProvider, String)

View Source
Declaration
public static string OrderByFields(IOrmLiteDialectProvider dialect, string orderBy)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.IOrmLiteDialectProviderdialect
System.StringorderBy

MaskPassword(String)

View Source
Declaration
public static string MaskPassword(string connectionString)
Returns

System.String

Parameters
TypeName
System.StringconnectionString