/// <summary> /// Determines whether this instance is withdrawn. /// </summary> /// <param name="source">The source.</param> /// <returns> /// <c>true</c> if the specified source is withdrawn; otherwise, <c>false</c>. /// </returns> public static bool IsWithdrawn(this ISupportFundingWithdrawal source) => It.Has(source) && source.EndDate < source.StartDate;
/// <summary> /// Determines whether the specified candidate is current. /// this caters for and evaluates if funding has been withdrawn /// </summary> /// <param name="source">The source.</param> /// <param name="candidate">The candidate.</param> /// <param name="optionalEnding">The optional ending.</param> /// <returns> /// <c>true</c> if the specified candidate is current; otherwise, <c>false</c>. /// </returns> public static bool IsCurrent(this ISupportFundingWithdrawal source, DateTime candidate, DateTime?optionalEnding = null) => It.Has(source) && !source.IsWithdrawn() && It.IsBetween(candidate, source.StartDate, optionalEnding ?? source.EndDate ?? DateTime.MaxValue);
public bool IsCurrentAndNotWithdrawn(ISupportFundingWithdrawal source, DateTime candidate, DateTime?optionalEnding = null) => source != null && !(source.EndDate < source.StartDate) && (candidate >= source.StartDate && (candidate <= (source.EndDate ?? DateTime.MaxValue)));