Exemplo n.º 1
0
 private void Store(GifAtMeContext stContext)
 {
     if (HttpContext.Current.Items.Contains(_dataContextKey))
     {
         HttpContext.Current.Items[_dataContextKey] = stContext;
     }
     else
     {
         HttpContext.Current.Items.Add(_dataContextKey, stContext);
     }
 }
        public GenericDomainTypeRepository(IUnitOfWork unitOfWork, IGifAtMeContextFactory contextFactory)
        {
            if (unitOfWork == null)
            {
                throw new ArgumentNullException("Unit of work");
            }
            _unitOfWork = unitOfWork;

            if (contextFactory == null)
            {
                throw new ArgumentNullException("DbContextFactory");
            }
            _context = contextFactory.Create();
        }
Exemplo n.º 3
0
        public GifAtMeContext Create()
        {
            GifAtMeContext stContext = null;

            if (HttpContext.Current.Items.Contains(_dataContextKey))
            {
                stContext = HttpContext.Current.Items[_dataContextKey] as GifAtMeContext;
            }
            else
            {
                stContext = new GifAtMeContext();
                Store(stContext);
            }
            return(stContext);
        }