Ejemplo n.º 1
0
 public UnitOfWorkManager(IMVCForumContext context)
 {
     //http://www.entityframeworktutorial.net/code-first/automated-migration-in-code-first.aspx
     Database.SetInitializer(new MigrateDatabaseToLatestVersion<MVCForumContext, Migrations.Configuration>(AppConstants.MvcForumContext));
     //Database.SetInitializer<MVCForumContext>(null);
     _context = context as MVCForumContext;
 }
Ejemplo n.º 2
0
        public UnitOfWorkManager(IMVCForumContext context)
        {
            // http://stackoverflow.com/questions/3552000/entity-framework-code-only-error-the-model-backing-the-context-has-changed-sinc
            Database.SetInitializer<MVCForumContext>(null);

            _context = context as MVCForumContext;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        public UnitOfWork(MVCForumContext context)
        {            
            _context = context;

            // In order to make calls that are overidden in the caching ef-wrapper, we need to use
            // transactions from the connection, rather than TransactionScope. 
            // This results in our call e.g. to commit() being intercepted 
            // by the wrapper so the cache can be adjusted.
            // This won't work with the dbcontext because it handles the connection itself, so we must use the underlying ObjectContext. 
            // http://blogs.msdn.com/b/diego/archive/2012/01/26/exception-from-dbcontext-api-entityconnection-can-only-be-constructed-with-a-closed-dbconnection.aspx
            _objectContext = ((IObjectContextAdapter) _context).ObjectContext;

            if (_objectContext.Connection.State != ConnectionState.Open)
            {
                _objectContext.Connection.Open();
                _transaction = _objectContext.Connection.BeginTransaction();
            }
        }
Ejemplo n.º 4
0
 public UploadedFileRepository(MVCForumContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public VoteRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public ActivityRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public GlobalPermissionForRoleRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public LocalizationRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public CategoryPermissionForRoleRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 10
0
 public PermissionRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 11
0
 public PostRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 12
0
 public BannedWordRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 13
0
 public BlockRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public CategoryRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 15
0
 public PollAnswerRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 16
0
 public FavouriteRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public SettingsRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public TopicTagRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public PrivateMessageRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 20
0
 public InstallerRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"> </param>
 public TopicNotificationRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
 public CategoryNotificationRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 public MembershipRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }
Ejemplo n.º 24
0
 public EmailRepository(IMVCForumContext context)
 {
     _context = context as MVCForumContext;
 }