/// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public virtual IEntityFinder Create(
     IStateManager stateManager,
     IDbSetSource setSource,
     IDbSetCache setCache,
     IEntityType type)
 => _cache.GetOrAdd(
     type.ClrType,
     t => (Func <IStateManager, IDbSetSource, IDbSetCache, IEntityType, IEntityFinder>)
     _genericCreate.MakeGenericMethod(t).Invoke(null, null))(stateManager, setSource, setCache, type);
Exemple #2
0
 public HarmonyEntityFinder(
     [NotNull] IStateManager stateManager,
     [NotNull] IDbSetSource setSource,
     [NotNull] IDbSetCache setCache,
     [NotNull] IEntityType entityType) : base(stateManager, setSource, setCache, entityType)
 {
     _stateManager = stateManager;
     _entityType   = entityType;
 }
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public EntityFinderFactory(
     IEntityFinderSource entityFinderSource,
     IStateManager stateManager,
     IDbSetSource setSource,
     IDbSetCache setCache)
 {
     _entityFinderSource = entityFinderSource;
     _stateManager       = stateManager;
     _setSource          = setSource;
     _setCache           = setCache;
 }
Exemple #4
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public EntityFinder(
     [NotNull] IStateManager stateManager,
     [NotNull] IDbSetSource setSource,
     [NotNull] IDbSetCache setCache,
     [NotNull] IEntityType entityType)
 {
     _stateManager = stateManager;
     _setSource    = setSource;
     _setCache     = setCache;
     _entityType   = entityType;
     _queryRoot    = (IQueryable <TEntity>)BuildQueryRoot(entityType);
 }
Exemple #5
0
 public IEntityFinder Create(IStateManager stateManager, IDbSetSource setSource, IDbSetCache setCache, IEntityType type)
 {
     return(Activator.CreateInstance(typeof(HarmonyEntityFinder <>).MakeGenericType(type.ClrType), stateManager, setSource, setCache, type) as IEntityFinder);
 }
Exemple #6
0
        public override IEntityFinder Create(IStateManager stateManager, IDbSetSource setSource, IDbSetCache setCache, IEntityType type)
        {
            var func = (Func <IStateManager, IDbSetSource, IDbSetCache, IEntityType, IEntityFinder>)
                       _genericCreate.MakeGenericMethod(type.ClrType).Invoke(null, null);

            return(func(stateManager, setSource, setCache, type));
        }