Esempio n. 1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new AvaliadorPIContext(serviceProvider.GetRequiredService <DbContextOptions <AvaliadorPIContext> >()))
            {
                if (context.Database.GetPendingMigrations().Any())
                {
                    context.Database.Migrate();
                }

                context.SaveChanges();
            }
        }
Esempio n. 2
0
 public UnitOfWork(AvaliadorPIContext context)
 {
     _context = context;
 }