webform membership2.0注入debug

        private IUserContract _UserService;
        public IUserContract UserService
        {
            get
            {
                if (_UserService == null)
                {
                    _UserService = ((IContainerProviderAccessor)HttpContext.Current.ApplicationInstance).ContainerProvider.ApplicationContainer.Resolve<IUserContract>();
                }
                return _UserService;
            }
        }

改为

        public IUserContract UserService { 
            get
            {
                return ((IContainerProviderAccessor)HttpContext.Current.ApplicationInstance).ContainerProvider.RequestLifetime.Resolve<IUserContract>();
            }
        }

 

posted @ 2016-06-14 11:44  shiningrise  阅读(189)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css