コード例 #1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new OrchardDBContext(
                       serviceProvider.GetRequiredService <DbContextOptions <OrchardDBContext> >()))
            {
                // Look for any movies.
                if (context.GlobalPlantList.Any())
                {
                    return; // DB has been seeded
                }
                //var globalPlantlist = new GlobalPlantList[]
                //{
                //    //new GlobalPlantList
                //    //{
                //    //  FruitVariety = "Apple",
                //    //  Name = "Cripps Pink 'Pink Lady'",
                //    //  Origin = "Australia",
                //    //  Parentage = "Golden Delicious x Lady Williams",
                //    //  Use = "Eating",
                //    //  YearDeveloped = "1970s",
                //    //  Comments = "Crisp, very sweet and slightly tart. Light red, pink and light yellow-green striped skin."

                //    //},

                //    //new GlobalPlantList
                //    //{
                //    //  FruitVariety = "Apple",
                //    //  Name = "HoneyCrisp",
                //    //  Origin = "Minnesota, US",
                //    //  Parentage = "Keepsake x MN1627",
                //    //},
                //    //new GlobalPlantList
                //    //{
                //    //  FruitVariety = "Peach",
                //    //  Name = "Red Haven",
                //    //  Origin = "Wisconsin, US",
                //    //  Parentage = "Red x White",
                //    //}
                //};
                //context.GlobalPlantList.AddRange(globalPlantlist);
                //context.SaveChanges();
            }
        }
コード例 #2
0
 public DetailsModel(Orchardist.Data.OrchardDBContext context)
 {
     _context = context;
 }
コード例 #3
0
 public IndexModel(Orchardist.Data.OrchardDBContext context)
 {
     _context = context;
 }
コード例 #4
0
ファイル: Edit.cshtml.cs プロジェクト: vmass20/Orchardist
 public EditModel(Orchardist.Data.OrchardDBContext context)
 {
     _context = context;
 }
コード例 #5
0
 public CreateModel(Orchardist.Data.OrchardDBContext context)
 {
     _context = context;
 }