Пример #1
0
        /// <summary>
        /// Create a new instance of repository
        /// </summary>
        /// <param name="unitOfWork">Associated Unit Of Work</param>
        public CFRepository(IQueryableUnitOfWork unitOfWork)
        {
            try
            {
                // LoggerHelper.Instance.Warning(string.Format("开始创建[{0}]Repository", EType.FullName));
                if (unitOfWork == (IUnitOfWork)null)
                {
                    throw new ArgumentNullException("unitOfWork");
                }

                _UnitOfWork = unitOfWork;
                Queryable   = _UnitOfWork.CreateQueryable <T>();
                DbSet       = _UnitOfWork.CreateQueryable <T>() as DbSet <T>;
                //LoggerHelper.Instance.Warning(string.Format("成功创建[{0}]Repository", EType.FullName));
            }
            catch (Exception ex)
            {
                LoggerHelper.Instance.Error(ex);
                HandleException(string.Format("创建[{0}]Repository出错", EType.FullName), ex);
            }
        }