예제 #1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new MySiteContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <MySiteContext> >()))
            {
                // Look for any company.
                if (context.Company.Any())
                {
                    return;   // DB has been seeded
                }

                context.Company.AddRange(
                    new Company
                {
                    Title                        = "Зоопарку требуется помощь",
                    Description                  = "Зоопарку нужно собрать деньги на ремонт",
                    Tags                         = "#зоопарк",
                    Images                       = "",
                    Video                        = "",
                    Topic                        = "Зоопарк",
                    ExpiryDate                   = DateTime.Parse("2021-3-13")
                                          Rating = "R"
                },
예제 #2
0
 public EditModel(MySite.Models.MySiteContext context)
 {
     _context = context;
 }
예제 #3
0
 public IndexModel(MySite.Models.MySiteContext context)
 {
     _context = context;
 }
예제 #4
0
 public DeleteModel(MySite.Models.MySiteContext context)
 {
     _context = context;
 }
예제 #5
0
 public DetailsModel(MySite.Models.MySiteContext context)
 {
     _context = context;
 }
예제 #6
0
 public CreateModel(MySite.Models.MySiteContext context)
 {
     _context = context;
 }