Esempio n. 1
0
    public static List <string> GetOldDatabasesFromUniqueDb(UniqueDbConnectionProvider uniqueDbConnectionProvider, TimeSpan olderThan)
    {
        var connection = uniqueDbConnectionProvider.ConnectionAsMaster();
        var databases  = connection
                         .Query <string>("SELECT NAME FROM SYSDATABASES")
                         .Where(x => x.StartsWith(uniqueDbConnectionProvider.Options.DatabaseNamePrefix))
                         .ToList();

        var dateTimeFormat        = uniqueDbConnectionProvider.Options.TimeStampFormat;
        var databases1HourOrOlder = SelectDatabaseNamesOlderThan(databases, dateTimeFormat, olderThan);

        return(databases1HourOrOlder.ToList());
    }