bin/projects/dbatools/dbatools/Utility/DateTimeExtension.cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;

namespace Sqlcollaborative.Dbatools.Utility
{
    /// <summary>
    /// Extends DateTime
    /// </summary>
    public static class DateTimeExtension
    {
        /// <summary>
        /// Adds a compareTo method to DateTime to compare with DbaDateTimeBase
        /// </summary>
        /// <param name="Base">The extended DateTime object</param>
        /// <param name="comparedTo">The DbaDateTimeBase to compare with</param>
        /// <returns></returns>
        public static int CompareTo(this DateTime Base, DbaDateTimeBase comparedTo)
        {
            return Base.CompareTo(comparedTo);
        }
    }
}