Exemplo n.º 1
0
        public UnitOfWork(IConfiguration settings)
        {
            var builder = new DbContextOptionsBuilder <CinderellaCoreContext>();

            builder.UseSqlServer(settings.GetConnectionString("DefaultConnection"));

            _context      = new CinderellaCoreContext(builder.Options);
            _repositories = new Dictionary <Type, object>();
            _disposed     = false;
        }
Exemplo n.º 2
0
 public static void Initialize(CinderellaCoreContext context)
 {
     context.Database.EnsureCreated();
 }
Exemplo n.º 3
0
 public Repository(CinderellaCoreContext context)
 {
     _context = context;
     _dbSet   = _context.Set <T>();
 }