Skip to main content

FuncUtils

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

Methods

TryExec(Action)

Invokes the action provided and returns true if no exception was thrown. Otherwise logs the exception and returns false if an exception was thrown.

View Source
Declaration
public static bool TryExec(Action action)
Returns

System.Boolean

Parameters
TypeNameDescription
System.ActionactionThe action.

|

TryExec<T>(Func<T>)

View Source
Declaration
public static T TryExec<T>(Func<T> func)
Returns

<T>

Parameters
TypeName
System.Func<<T>>func
Type Parameters
  • T

TryExec<T>(Func<T>, T)

View Source
Declaration
public static T TryExec<T>(Func<T> func, T defaultValue)
Returns

<T>

Parameters
TypeName
System.Func<<T>>func
<T>defaultValue
Type Parameters
  • T

WaitWhile(Func<Boolean>, Int32, Int32)

View Source
Declaration
public static void WaitWhile(Func<bool> condition, int millisecondTimeout, int millsecondPollPeriod = 10)
Parameters
TypeName
System.Func<System.Boolean>condition
System.Int32millisecondTimeout
System.Int32millsecondPollPeriod