Class PeriodValueExtensions
Inheritance
PeriodValueExtensions
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public static class PeriodValueExtensions
Methods
GetDurations(IEnumerable<PeriodValue>)
Extract all date period durations
Declaration
public static IEnumerable<TimeSpan> GetDurations(this IEnumerable<PeriodValue> values)
Parameters
Returns
GetPeriod(IEnumerable<PeriodValue>)
Get the date period over all values, from the earliest start to the latest end
Declaration
public static DatePeriod GetPeriod(this IEnumerable<PeriodValue> values)
Parameters
Returns
| Type |
Description |
| DatePeriod |
The overall period, anytime in case of an empty source
|
GetPeriodEnd(IEnumerable<PeriodValue>)
Declaration
public static DateTime? GetPeriodEnd(this IEnumerable<PeriodValue> values)
Parameters
Returns
| Type |
Description |
| DateTime? |
The latest end date
|
GetPeriodEnds(IEnumerable<PeriodValue>)
Extract all date end dates
Declaration
public static IEnumerable<DateTime> GetPeriodEnds(this IEnumerable<PeriodValue> values)
Parameters
Returns
GetPeriodStart(IEnumerable<PeriodValue>)
Get the earliest start date
Declaration
public static DateTime? GetPeriodStart(this IEnumerable<PeriodValue> values)
Parameters
Returns
| Type |
Description |
| DateTime? |
The earliest start date
|
GetPeriodStarts(IEnumerable<PeriodValue>)
Extract all date start dates
Declaration
public static IEnumerable<DateTime> GetPeriodStarts(this IEnumerable<PeriodValue> values)
Parameters
Returns
GetPeriods(IEnumerable<PeriodValue>)
Declaration
public static IEnumerable<DatePeriod> GetPeriods(this IEnumerable<PeriodValue> values)
Parameters
Returns
ToDateTime(PeriodValue)
Convert case period value to date time/>
Declaration
public static DateTime ToDateTime(this PeriodValue periodValue)
Parameters
Returns
ToDecimal(PeriodValue)
Convert case period value to decimal/>
Declaration
public static decimal ToDecimal(this PeriodValue periodValue)
Parameters
Returns
ToDecimal(PeriodValue, DecimalRounding)
Convert case period value to decimal
Declaration
public static decimal ToDecimal(this PeriodValue periodValue, DecimalRounding rounding)
Parameters
Returns
ToInt(PeriodValue)
Convert case period value to int/>
Declaration
public static int ToInt(this PeriodValue periodValue)
Parameters
Returns
ToNullableDateTime(PeriodValue)
Convert case period value to nullable date time/>
Declaration
public static DateTime? ToNullableDateTime(this PeriodValue periodValue)
Parameters
Returns
ToNullableDecimal(PeriodValue)
Convert case period value to nullable decimal/>
Declaration
public static decimal? ToNullableDecimal(this PeriodValue periodValue)
Parameters
Returns
ToNullableDecimal(PeriodValue, DecimalRounding)
Convert case period value to nullable decimal/>
Declaration
public static decimal? ToNullableDecimal(this PeriodValue periodValue, DecimalRounding rounding)
Parameters
Returns
ToNullableInt(PeriodValue)
Convert case period value to nullable int/>
Declaration
public static int? ToNullableInt(this PeriodValue periodValue)
Parameters
Returns
ToString(PeriodValue)
Convert case period value to string/>
Declaration
public static string ToString(this PeriodValue periodValue)
Parameters
Returns
TotalDaysByValue(IEnumerable<PeriodValue>)
Total days considering the value as factor
Declaration
public static decimal TotalDaysByValue(this IEnumerable<PeriodValue> values)
Parameters
Returns
| Type |
Description |
| decimal |
Total days by value as factor
|
TotalDaysByValue(IEnumerable<PeriodValue>, bool)
Total days considering the value as factor
Declaration
public static decimal TotalDaysByValue(this IEnumerable<PeriodValue> values, bool includeEndDay)
Parameters
Returns
| Type |
Description |
| decimal |
Total days by value as factor
|
TotalDuration(IEnumerable<PeriodValue>)
Summarize the total duration from all date period durations
Declaration
public static TimeSpan TotalDuration(this IEnumerable<PeriodValue> values)
Parameters
Returns
| Type |
Description |
| TimeSpan |
Total duration from all periods, an empty time span on empty collection
|
ValueAs(PeriodValue, Type)
Convert case period value to custom type
Declaration
public static object ValueAs(this PeriodValue periodValue, Type type)
Parameters
Returns
| Type |
Description |
| object |
Accumulated total duration
|
ValueAs<T>(PeriodValue, T)
Convert case period value to custom type
Declaration
public static T ValueAs<T>(this PeriodValue periodValue, T defaultValue = default)
Parameters
| Type |
Name |
Description |
| PeriodValue |
periodValue |
|
| T |
defaultValue |
The default value
|
Returns
| Type |
Description |
| T |
Accumulated total duration
|
Type Parameters