/// <summary>
        /// 重写以筛选出当前上下文的实体映射信息
        /// </summary>
        protected override IEnumerable<IEntityMapper> EntityMappersFilter(IEnumerable<IEntityMapper> entityMappers)
        {
            Type contextType = typeof(TDbContext);
            Expression<Func<IEntityMapper, bool>> predicate = m => m.DbContextType == contextType;
            if (contextType == typeof(DefaultDbContext))
            {
                predicate = predicate.Or(m => m.DbContextType == null);
            }
            return entityMappers.Where(predicate.Compile());
        }

相关文章:

  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
相关资源
相似解决方案