Class FallbackExtensions
Inheritance
FallbackExtensions
Assembly: Glitch9.dll
Syntax
public static class FallbackExtensions
Methods
|
Edit this page
View Source
IsOr<TParent, TChild>(TParent, TChild)
Declaration
public static TChild IsOr<TParent, TChild>(this TParent obj, TChild fallbackChild) where TChild : TParent
Parameters
| Type |
Name |
Description |
| TParent |
obj |
|
| TChild |
fallbackChild |
|
Returns
Type Parameters
| Name |
Description |
| TParent |
|
| TChild |
|
|
Edit this page
View Source
Or(string, string)
Returns the fallback string if the original string is null, empty, or consists only of white-space characters.
Super often used to provide default values for optional string parameters.
Declaration
public static string Or(this string value, string fallback)
Parameters
Returns
|
Edit this page
View Source
OrDefault<TEnum>(TEnum?)
Declaration
public static TEnum OrDefault<TEnum>(this TEnum? value) where TEnum : struct, Enum
Parameters
| Type |
Name |
Description |
| TEnum? |
value |
|
Returns
Type Parameters
|
Edit this page
View Source
OrEmpty<TCol>(TCol)
Declaration
public static TCol OrEmpty<TCol>(this TCol c) where TCol : class, ICollection, new()
Parameters
| Type |
Name |
Description |
| TCol |
c |
|
Returns
Type Parameters
|
Edit this page
View Source
OrFalse(bool?)
Declaration
public static bool OrFalse(this bool? value)
Parameters
| Type |
Name |
Description |
| bool? |
value |
|
Returns
|
Edit this page
View Source
OrZero(int?)
Declaration
public static int OrZero(this int? value)
Parameters
| Type |
Name |
Description |
| int? |
value |
|
Returns
|
Edit this page
View Source
OrZero(float?)
Declaration
public static float OrZero(this float? value)
Parameters
| Type |
Name |
Description |
| float? |
value |
|
Returns
|
Edit this page
View Source
ToStringOrDash(int)
Declaration
public static string ToStringOrDash(this int value)
Parameters
| Type |
Name |
Description |
| int |
value |
|
Returns