private object UpdateCurrencyRates() { //TODO: Fill real cron expression var config = new { CronExpression = "" }; var json = JsonConvert.SerializeObject(config); var node = JsonConvert.DeserializeXNode(json, "Setting"); return new { Key = string.Format(SettingKey, "UpdateCurrencyRates"), Value = node.ToString() }; }
private static object UsdRange() { var limits = new { AmountPerDayLocal = Range.Create<decimal>(5m, 100000m), AmountPerDayAbroad = Range.Create<decimal>(5m, 50000m), OperationsPerDayLocal = Range.Create(0, 500), OperationsPerDayAbroad = Range.Create(0, 250), }; var json = JsonConvert.SerializeObject(limits); var node = JsonConvert.DeserializeXNode(json, "Setting"); return new { Key = string.Format(Key, "USD"), Value = node.ToString() }; }
public override string Generate(FluentMigrator.Expressions.DeleteDataExpression expression) { throw new NotImplementedException(); }
public override string Generate(FluentMigrator.Expressions.AlterDefaultConstraintExpression expression) { throw new NotImplementedException(); }
public override string Generate(FluentMigrator.Expressions.RenameColumnExpression expression) { throw new NotImplementedException(); }
public override string Generate(FluentMigrator.Expressions.CreateIndexExpression expression) { throw new NotImplementedException(); }
public NzbDroneSqliteProcessor(IDbConnection connection, IMigrationGenerator generator, IAnnouncer announcer, IMigrationProcessorOptions options, FluentMigrator.Runner.Processors.IDbFactory factory) : base(connection, generator, announcer, options, factory) { }
public static void AddUpdate(FluentMigrator.Migration obj, string Text) { obj.Insert.IntoTable("Updates") .Row(new { Date = Now, Text = Text }); }
private static IMigrationInfo GetMigrationInfoFor(FluentMigrator.IMigration migration) { var migrationType = migration.GetType(); var migrationAttribute = migrationType.GetOneAttribute<MigrationAttribute>(); var chunSunMigration = migration as MigrationBase; if (chunSunMigration == null) throw new Exception("迁移提供程序必须继承自 \"" + typeof(MigrationBase).FullName + "\" 类型。"); var id = chunSunMigration.Feature.Descriptor.Id; var version = migrationAttribute.Version; var description = id + "_" + migrationAttribute.Description + "_" + migrationAttribute.Version; var migrationInfo = new MigrationInfo(version, description, migrationAttribute.TransactionBehavior, () => migration); var allAttributes = migrationType.GetAllAttributes<MigrationTraitAttribute>(); foreach (var traitAttribute in allAttributes) migrationInfo.AddTrait(traitAttribute.Name, traitAttribute.Value); return migrationInfo; }
public static void InputTable(FluentMigrator.Migration mig, string Table, List<Dictionary<string, object>> data) { System.Console.WriteLine("Adding Table: " + Table); foreach (var entry in data) { mig.Insert.IntoTable(Table) .Row(entry); } System.Console.WriteLine("Added Table: " + Table); }