Class ILogCallExtensions
Extensions for ILogCall objects which don't need to return a value.
[PublicApi]
public static class ILogCallExtensions
- Inheritance
-
ILogCallExtensions
Methods
Done(ILogCall)
Complete/close an ILogCall without returning a value.
public static void Done(this ILogCall logCall)
Parameters
logCall
ILogCallThe log call or null
Done(ILogCall, string)
Complete/close an ILogCall without returning a value, and also add a message.
public static void Done(this ILogCall logCall, string message)
Parameters
Done<T>(ILogCall, T)
Complete/close an ILogCall without returning a value, and also add a message.
public static T Done<T>(this ILogCall logCall, T exception) where T : Exception
Parameters
logCall
ILogCallThe log call or null
exception
T
Returns
- T
Type Parameters
T
ReturnAndLogIfNull<T>(ILogCall<T>, T)
public static T ReturnAndLogIfNull<T>(this ILogCall<T> logCall, T result)
Parameters
logCall
ILogCall<T>result
T
Returns
- T
Type Parameters
T
ReturnAndLog<T>(ILogCall<T>, T)
Return a value and log the result as well. Note that if the object supports ICanDump it will use that dump to log it's value.
public static T ReturnAndLog<T>(this ILogCall<T> logCall, T result)
Parameters
logCall
ILogCall<T>The log call or null
result
T
Returns
- T
Type Parameters
T
ReturnAndLog<T>(ILogCall<T>, T, string)
Return a value and log the result as well + add a message. Note that if the object supports ICanDump it will use that dump to log it's value.
public static T ReturnAndLog<T>(this ILogCall<T> logCall, T result, string message)
Parameters
Returns
- T
Type Parameters
T
ReturnAsError<T>(ILogCall<T>, T, string)
Return a value with the standard message "error"
public static T ReturnAsError<T>(this ILogCall<T> logCall, T result, string message = null)
Parameters
Returns
- T
Type Parameters
T
ReturnAsOk<T>(ILogCall<T>, T)
Return a value with the standard message "ok"
public static T ReturnAsOk<T>(this ILogCall<T> logCall, T result)
Parameters
logCall
ILogCall<T>The log call or null
result
T
Returns
- T
Type Parameters
T
ReturnEmpty(ILogCall<string>)
Return true
for ILogCall bool
objects.
public static string ReturnEmpty(this ILogCall<string> logCall)
Parameters
Returns
ReturnEmpty(ILogCall<string>, string)
Return true
for ILogCall bool
objects.
public static string ReturnEmpty(this ILogCall<string> logCall, string message)
Parameters
Returns
ReturnFalse(ILogCall<bool>)
Return false
for ILogCall bool
objects.
public static bool ReturnFalse(this ILogCall<bool> logCall)
Parameters
Returns
ReturnFalse(ILogCall<bool>, string)
Return false
for ILogCall bool
objects with a message.
public static bool ReturnFalse(this ILogCall<bool> logCall, string message)
Parameters
Returns
ReturnNull<T>(ILogCall<T>)
Return a null or the default value (like a zero for int) without further messages.
public static T ReturnNull<T>(this ILogCall<T> logCall)
Parameters
logCall
ILogCall<T>The log call or null
Returns
- T
Type Parameters
T
ReturnNull<T>(ILogCall<T>, string)
Return a null or the default value (like a zero for int) with specified message.
public static T ReturnNull<T>(this ILogCall<T> logCall, string message)
Parameters
Returns
- T
Type Parameters
T
ReturnTrue(ILogCall<bool>)
Return true
for ILogCall bool
objects.
public static bool ReturnTrue(this ILogCall<bool> logCall)
Parameters
Returns
ReturnTrue(ILogCall<bool>, string)
Return true
for ILogCall bool
objects with a message.
public static bool ReturnTrue(this ILogCall<bool> logCall, string message)
Parameters
Returns
Return<T>(ILogCall<T>, T)
Close the log call and return a specific result, without adding any message.
public static T Return<T>(this ILogCall<T> logCall, T result)
Parameters
logCall
ILogCall<T>The log call or null
result
TThe result to return
Returns
- T
The result specified
Type Parameters
T
Return<T>(ILogCall<T>, T, string)
Close the log call and return a specific result, without adding any message.
public static T Return<T>(this ILogCall<T> logCall, T result, string message)
Parameters
logCall
ILogCall<T>The log call or null
result
TThe result to return
message
stringMessage to add to the log
Returns
- T
The result specified
Type Parameters
T