Disco.Services.JobQueueExtensions.OnEditSla C# (CSharp) Method

OnEditSla() public static method

public static OnEditSla ( this jqj, System.DateTime SlaExpiresDate ) : void
jqj this
SlaExpiresDate System.DateTime
return void
        public static void OnEditSla(this JobQueueJob jqj, DateTime? SlaExpiresDate)
        {
            if (!jqj.CanEditSla())
                throw new InvalidOperationException("Editing job SLA for this queue is denied");

            if (SlaExpiresDate.HasValue && jqj.AddedDate > SlaExpiresDate.Value)
                throw new ArgumentException("The SLA Expires Date must be greater than the Added Date", "SLAExpiresDate");

            jqj.SLAExpiresDate = SlaExpiresDate;
        }
        #endregion