Class FragmentExtensions
- Namespace
- Songhay.Publications.Extensions
- Assembly
- Songhay.Publications.dll
Extensions of IFragment
public static class FragmentExtensions
- Inheritance
-
FragmentExtensions
- Inherited Members
Methods
Clone(IFragment?)
Clones the instance of IFragment.
public static Fragment? Clone(this IFragment? data)
Parameters
data
IFragmentThe document.
Returns
GetFragmentByPredicate(IEnumerable<IFragment>?, Func<IFragment, bool>)
Returns and traces the first IFragment based on the specified predicate.
public static IFragment? GetFragmentByPredicate(this IEnumerable<IFragment>? data, Func<IFragment, bool> predicate)
Parameters
data
IEnumerable<IFragment>The data.
predicate
Func<IFragment, bool>The predicate.
Returns
SetDefaults(IFragment?)
Sets the defaults.
public static void SetDefaults(this IFragment? data)
Parameters
data
IFragmentThe fragment.
ToDisplayText(IFragment?)
Converts the IFragment into human-readable display text.
public static string ToDisplayText(this IFragment? data)
Parameters
data
IFragmentThe data.
Returns
ToDisplayText(IFragment?, bool)
Converts the IFragment into a display text.
public static string ToDisplayText(this IFragment? data, bool showIdOnly)
Parameters
Returns
ToMenuDisplayItemModel(IFragment?)
Converts the IFragment into a menu display item model.
public static MenuDisplayItemModel? ToMenuDisplayItemModel(this IFragment? data)
Parameters
data
IFragmentThe fragment.
Returns
- MenuDisplayItemModel
ToMenuDisplayItemModel(IFragment?, IGroupable?)
Converts the IFragment into a menu display item model.
public static MenuDisplayItemModel? ToMenuDisplayItemModel(this IFragment? data, IGroupable? group)
Parameters
data
IFragmentThe fragment.
group
IGroupableThe group.
Returns
- MenuDisplayItemModel
ToMenuDisplayItemModel(IFragment?, IGroupable?, bool)
Converts the IFragment into a menu display item model.
public static MenuDisplayItemModel? ToMenuDisplayItemModel(this IFragment? data, IGroupable? group, bool copyFragmentContent)
Parameters
data
IFragmentThe document.
group
IGroupableThe group.
copyFragmentContent
boolif set to
true
include IFragment content.
Returns
- MenuDisplayItemModel
ToMenuDisplayItemModel(IFragment?, bool)
Converts the IFragment into a menu display item model.
public static MenuDisplayItemModel? ToMenuDisplayItemModel(this IFragment? data, bool copyFragmentContent)
Parameters
Returns
- MenuDisplayItemModel
ToValidationResult(IFragment?)
Converts the IDocument data to FluentValidation.Results.ValidationResult.
public static ValidationResult ToValidationResult(this IFragment? data)
Parameters
Returns
- ValidationResult
WithDefaults(IFragment?)
Returns IFragment with default values.
public static IFragment? WithDefaults(this IFragment? data)
Parameters
data
IFragmentThe data.
Returns
WithEdit(IFragment?, Action<IFragment>?)
public static IFragment WithEdit(this IFragment? data, Action<IFragment>? editAction)