Skip to main content

AssertExtensions

Assembly: ServiceStack.Common.dll
View Source
Declaration
public static class AssertExtensions

Methods

ThrowOnFirstNull(Object[])

View Source
Declaration
public static void ThrowOnFirstNull(params object[] objs)
Parameters
TypeName
System.Object[]objs

ThrowIfNull(Object)

View Source
Declaration
public static void ThrowIfNull(this object obj)
Parameters
TypeName
System.Objectobj

ThrowIfNull(Object, String)

View Source
Declaration
public static void ThrowIfNull(this object obj, string varName)
Parameters
TypeName
System.Objectobj
System.StringvarName

ThrowIfNull<T>(T, String)

View Source
Declaration
public static T ThrowIfNull<T>(this T obj, string varName)
Returns

<T>

Parameters
TypeName
<T>obj
System.StringvarName
Type Parameters
  • T

ThrowIfNullOrEmpty(String)

View Source
Declaration
public static string ThrowIfNullOrEmpty(this string strValue)
Returns

System.String

Parameters
TypeName
System.StringstrValue

ThrowIfNullOrEmpty(String, String)

View Source
Declaration
public static string ThrowIfNullOrEmpty(this string strValue, string varName)
Returns

System.String

Parameters
TypeName
System.StringstrValue
System.StringvarName

ThrowIfNullOrEmpty(ICollection)

View Source
Declaration
public static ICollection ThrowIfNullOrEmpty(this ICollection collection)
Returns

System.Collections.ICollection

Parameters
TypeName
System.Collections.ICollectioncollection

ThrowIfNullOrEmpty(ICollection, String)

View Source
Declaration
public static ICollection ThrowIfNullOrEmpty(this ICollection collection, string varName)
Returns

System.Collections.ICollection

Parameters
TypeName
System.Collections.ICollectioncollection
System.StringvarName

ThrowIfNullOrEmpty<T>(ICollection<T>)

View Source
Declaration
public static ICollection<T> ThrowIfNullOrEmpty<T>(this ICollection<T> collection)
Returns

System.Collections.Generic.ICollection<<T>>

Parameters
TypeName
System.Collections.Generic.ICollection<<T>>collection
Type Parameters
  • T

ThrowIfNullOrEmpty<T>(ICollection<T>, String)

View Source
Declaration
public static ICollection<T> ThrowIfNullOrEmpty<T>(this ICollection<T> collection, string varName)
Returns

System.Collections.Generic.ICollection<<T>>

Parameters
TypeName
System.Collections.Generic.ICollection<<T>>collection
System.StringvarName
Type Parameters
  • T