Table of Contents

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 IFragment

The document.

Returns

Fragment

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

IFragment

SetDefaults(IFragment?)

Sets the defaults.

public static void SetDefaults(this IFragment? data)

Parameters

data IFragment

The fragment.

ToDisplayText(IFragment?)

Converts the IFragment into human-readable display text.

public static string ToDisplayText(this IFragment? data)

Parameters

data IFragment

The data.

Returns

string

ToDisplayText(IFragment?, bool)

Converts the IFragment into a display text.

public static string ToDisplayText(this IFragment? data, bool showIdOnly)

Parameters

data IFragment

The data.

showIdOnly bool

when true then display identifiers only

Returns

string

ToMenuDisplayItemModel(IFragment?)

Converts the IFragment into a menu display item model.

public static MenuDisplayItemModel? ToMenuDisplayItemModel(this IFragment? data)

Parameters

data IFragment

The 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 IFragment

The fragment.

group IGroupable

The 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 IFragment

The document.

group IGroupable

The group.

copyFragmentContent bool

if 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

data IFragment

The data.

copyFragmentContent bool

if set to true include IFragment content.

Returns

MenuDisplayItemModel

ToValidationResult(IFragment?)

Converts the IDocument data to FluentValidation.Results.ValidationResult.

public static ValidationResult ToValidationResult(this IFragment? data)

Parameters

data IFragment

the IDocument data

Returns

ValidationResult

WithDefaults(IFragment?)

Returns IFragment with default values.

public static IFragment? WithDefaults(this IFragment? data)

Parameters

data IFragment

The data.

Returns

IFragment

WithEdit(IFragment?, Action<IFragment>?)

Returns IFragment after the specified edit Action<T>.

public static IFragment WithEdit(this IFragment? data, Action<IFragment>? editAction)

Parameters

data IFragment

The data.

editAction Action<IFragment>

The edit action.

Returns

IFragment