public SeedModule() { Seed = new Seed(); Schema = new Schema(Seed); Post["seed/purgedb"] = _ => { Seed.PurgeDb(); return(this.OK()); }; Post["seed/export"] = _ => { var exportPath = new AspNetRootSourceProvider().GetRootPath(); Seed.Export(exportPath, Schema.Scripts()); return("Scripts executed to: " + exportPath); }; Post["seed/all"] = _ => { Schema.Scripts().ForEach <dynamic>(s => Seed.ExecuteNonQuery(s())); return(this.OK()); }; Post["seed/sampleentries"] = _ => { Schema.SampleEntries(); return(this.OK()); }; }
public static string GetPostsPath() { IRootPathProvider rootPathProvider = new AspNetRootSourceProvider(); return(GetPostsPath(rootPathProvider)); }