Table of Contents

Class SegmentExtensions

Namespace
Songhay.Publications.Extensions
Assembly
Songhay.Publications.dll

Extensions of ISegment

public static class SegmentExtensions
Inheritance
SegmentExtensions
Inherited Members

Methods

Clone(ISegment?)

Clones the instance of ISegment.

public static Segment? Clone(this ISegment? data)

Parameters

data ISegment

The document.

Returns

Segment

GetSegmentByPredicate(IEnumerable<ISegment>?, Func<ISegment, bool>)

Returns and traces the first ISegment based on the specified predicate.

public static ISegment? GetSegmentByPredicate(this IEnumerable<ISegment>? data, Func<ISegment, bool> predicate)

Parameters

data IEnumerable<ISegment>

The data.

predicate Func<ISegment, bool>

The predicate.

Returns

ISegment

HasDocuments(ISegment?)

Returns true when the ISegment has any Documents.

public static bool HasDocuments(this ISegment? data)

Parameters

data ISegment

Returns

bool

SetDefaults(ISegment?)

Sets the defaults.

public static void SetDefaults(this ISegment? data)

Parameters

data ISegment

The data.

ToDisplayText(ISegment?)

Converts the ISegment into human-readable display text.

public static string ToDisplayText(this ISegment? data)

Parameters

data ISegment

The data.

Returns

string

ToDisplayText(ISegment?, bool)

Converts the ISegment into human-readable display text.

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

Parameters

data ISegment

The data.

showIdOnly bool

when true then display identifiers only

Returns

string

ToMenuDisplayItemModel(ISegment?)

Converts the ISegment into a menu display item model.

public static MenuDisplayItemModel? ToMenuDisplayItemModel(this ISegment? data)

Parameters

data ISegment

The data.

Returns

MenuDisplayItemModel

ToMenuDisplayItemModel(ISegment?, IGroupable?)

Converts the ISegment into a menu display item model.

public static MenuDisplayItemModel? ToMenuDisplayItemModel(this ISegment? data, IGroupable? group)

Parameters

data ISegment

The data.

group IGroupable

The group.

Returns

MenuDisplayItemModel

ToPublicationIndexEntries(IEnumerable<ISegment>)

Converts the IEnumerable<T> to IEnumerable<T>.

public static IEnumerable<IIndexEntry> ToPublicationIndexEntries(this IEnumerable<ISegment> data)

Parameters

data IEnumerable<ISegment>

The data.

Returns

IEnumerable<IIndexEntry>

ToPublicationIndexEntry(ISegment?)

Converts the ISegment to IIndexEntry.

public static IIndexEntry ToPublicationIndexEntry(this ISegment? data)

Parameters

data ISegment

The data.

Returns

IIndexEntry

ToValidationResult(ISegment?)

Converts the IDocument data to FluentValidation.Results.ValidationResult.

public static ValidationResult ToValidationResult(this ISegment? data)

Parameters

data ISegment

the IDocument data

Returns

ValidationResult

WithDefaults(ISegment?)

Returns ISegment with default values.

public static ISegment? WithDefaults(this ISegment? data)

Parameters

data ISegment

The data.

Returns

ISegment

WithEdit(ISegment?, Action<ISegment>?)

Returns ISegment after the specified edit Action<T>.

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

Parameters

data ISegment

The data.

editAction Action<ISegment>

The edit action.

Returns

ISegment