Beispiel #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;
        }
 public static void Initialize(CinderellaCoreContext context)
 {
     context.Database.EnsureCreated();
 }
Beispiel #3
0
 public Repository(CinderellaCoreContext context)
 {
     _context = context;
     _dbSet   = _context.Set <T>();
 }