NServiceBus.TimeToBeReceivedAttribute.TimeToBeReceivedAttribute C# (CSharp) Method

TimeToBeReceivedAttribute() public method

Sets the time to be received.
public TimeToBeReceivedAttribute ( string timeSpan ) : System
timeSpan string A timeSpan that can be interpreted by .
return System
        public TimeToBeReceivedAttribute(string timeSpan)
        {
            Guard.AgainstNullAndEmpty(nameof(timeSpan), timeSpan);
            TimeSpan parsed;
            if (!TimeSpan.TryParse(timeSpan, out parsed))
            {
                var error = $"Could not parse '{timeSpan}' as a timespan.";
                throw new ArgumentException(error);
            }
            Guard.AgainstNegativeAndZero(nameof(timeSpan), parsed);
            TimeToBeReceived = parsed;
        }
TimeToBeReceivedAttribute