Table of Contents

Class UnitDutyPeriod

Namespace
XENBIT.ResQueServe.Core.Models
Assembly
RQS.Core.dll
public record UnitDutyPeriod : IUnitDutyPeriod, IEquatable<UnitDutyPeriod>
Inheritance
UnitDutyPeriod
Implements
Inherited Members
Extension Methods

Constructors

UnitDutyPeriod()

public UnitDutyPeriod()

UnitDutyPeriod(UnitDutyPeriod)

protected UnitDutyPeriod(UnitDutyPeriod original)

Parameters

original UnitDutyPeriod

Properties

Day

Represents the day of the week for the duty period.

public DayOfWeek Day { get; set; }

Property Value

DayOfWeek

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

HourEnd

Represents the ending hour of the duty period.

public int HourEnd { get; set; }

Property Value

int

HourStart

Represents the starting hour of the duty period.

public int HourStart { get; set; }

Property Value

int

Id

public long Id { get; set; }

Property Value

long

MinuteEnd

Represents the ending minute of the duty period.

public int MinuteEnd { get; set; }

Property Value

int

MinuteStart

Represents the starting minute of the duty period.

public int MinuteStart { get; set; }

Property Value

int

Methods

EndToTimeOnly()

public TimeOnly EndToTimeOnly()

Returns

TimeOnly

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(UnitDutyPeriod?)

public virtual bool Equals(UnitDutyPeriod? other)

Parameters

other UnitDutyPeriod

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

IsDutyPeriodApplicable(DateTime)

Determines if the duty period is applicable at the specified date and time.

public bool IsDutyPeriodApplicable(DateTime dateTime)

Parameters

dateTime DateTime

The date and time to check.

Returns

bool

True if the duty period is applicable at the specified date and time; otherwise, false.

IsValid()

Checks if the duty period has valid start and end times.

public bool IsValid()

Returns

bool

True if the duty period has valid start and end times; otherwise, false.

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

StartToTimeOnly()

public TimeOnly StartToTimeOnly()

Returns

TimeOnly

TimeUntilShiftEnd(DateTime)

Calculates the time until the end of the duty shift.

public TimeSpan TimeUntilShiftEnd(DateTime currentTime)

Parameters

currentTime DateTime

The current time.

Returns

TimeSpan

The time until the end of the duty shift.

Exceptions

InvalidOperationException

Thrown if the duty period is not applicable at the given time.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(UnitDutyPeriod?, UnitDutyPeriod?)

public static bool operator ==(UnitDutyPeriod? left, UnitDutyPeriod? right)

Parameters

left UnitDutyPeriod
right UnitDutyPeriod

Returns

bool

operator !=(UnitDutyPeriod?, UnitDutyPeriod?)

public static bool operator !=(UnitDutyPeriod? left, UnitDutyPeriod? right)

Parameters

left UnitDutyPeriod
right UnitDutyPeriod

Returns

bool