public static async Task PerormPreflightOperations(IWebHost host, string[] args) { if (args.Contains("--seed") || args.Contains("-s")) { using (IServiceScope scope = host.Services.CreateScope()) { IServiceProvider services = scope.ServiceProvider; BudgetTrackerContext context = services.GetRequiredService <BudgetTrackerContext>(); IConfiguration appConfig = services.GetRequiredService <IConfiguration>(); BasicSeed seeder = new BasicSeed(context, appConfig); await seeder.Seed(); } } }
public static void run() { var para = new List<KeyValuePair<string,string>>(); KeyValuePair<string, string> p1 = new KeyValuePair<string, string>("id","int"); KeyValuePair<string, string> p2 = new KeyValuePair<string, string>("uid", "string"); para.Add(p1); para.Add(p2); var product = new BasicSeed { ReturnType= "ContactEmail", FuncName="Validate", Params = para }; string cls = JsonConvert.SerializeObject(product); seed test = new seed(cls); var basic = test.getBasicSeed(); CodeTemplate codet = new CodeTemplate(basic); var v1 = codet.gen(); codet.writeFile(v1); }
public CodeTemplate(BasicSeed bseed) { this._basicseed = bseed; }