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(); }
public Repository(CinderellaCoreContext context) { _context = context; _dbSet = _context.Set <T>(); }