コード例 #1
0
 private void DeleteDatabaseBackup(Database db, SqlExecutor dbExecutor)
 {
     if (!WhatIf)
     {
         dbExecutor.Execute(string.Format("DROP DATABASE {0}", db.Name));
     }
     Log.Info("Deleted database {0}.", db.Name);
 }
コード例 #2
0
        private static int GetDay(Database db)
        {
            var timestamp = Util.GetDatabaseNameTimestamp(db);
            var date = Util.GetDateTimeFromTimestamp(timestamp);
            if (date.Kind != DateTimeKind.Utc)
            {
                throw new InvalidDataException("DateTime must be Utc");
            }

            var daysSinceMillenium = (int)date.Subtract(new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalDays;
            return daysSinceMillenium;
        }
コード例 #3
0
ファイル: Util.cs プロジェクト: rajwilkhu/NuGetOperations
 public static string GetDatabaseNameTimestamp(Database database)
 {
     return GetDatabaseNameTimestamp(database.Name);
 }
コード例 #4
0
 private static DateTime GetTimestamp(Database db)
 {
     var timestamp = Util.GetDatabaseNameTimestamp(db);
     var date = Util.GetDateTimeFromTimestamp(timestamp);
     return date;
 }