示例#1
0
        private static void TruncateLogIfRequired(MigrationRecord record)
        {
            if (record.Log == null || record.Log.Length <= MigrationRecord.DefaultMaxLogLength)
            {
                return;
            }

            var suffix = Environment.NewLine + "… Log limit reached …";

            record.Log = record.Log.Substring(0, MigrationRecord.DefaultMaxLogLength - suffix.Length) + suffix;
        }
示例#2
0
 public void SaveNew(MigrationRecord record)
 {
     EnsureTable();
     TruncateLogIfRequired(record);
     _database.Insert(record);
 }