Exemplo n.º 1
0
        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());
            };
        }
Exemplo n.º 2
0
        public static string GetPostsPath()
        {
            IRootPathProvider rootPathProvider = new AspNetRootSourceProvider();

            return(GetPostsPath(rootPathProvider));
        }