Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="IvAt.CommonFramework" Version="2.1.13" />
<PackageVersion Include="IvAt.CommonFramework.DependencyInjection" Version="2.1.13" />
<PackageVersion Include="IvAt.CommonFramework" Version="2.1.14" />
<PackageVersion Include="IvAt.CommonFramework.DependencyInjection" Version="2.1.14" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.2" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace GenericQueryable.Fetching;

public record UntypedFetchRule<TSource>(string Path) : FetchRule<TSource>;
public sealed record UntypedFetchRule<TSource>(string Path) : FetchRule<TSource>;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class FetchRuleHeaderExpander(IEnumerable<FetchRuleHeaderInfo> fetchRuleH
{
if (fetchRule is FetchRuleHeader<TSource> fetchRuleHeader)
{
return cache.GetOrAdd(typeof(TSource),
return cache.GetOrAdd(fetchRuleHeader.GetType(),
_ => headersDict
.GetValueOrDefault(typeof(TSource))
.EmptyIfNull()
Expand Down
3 changes: 1 addition & 2 deletions src/GenericQueryable.Runtime/Fetching/FetchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace GenericQueryable.Fetching;

public abstract class FetchService([FromKeyedServices(RootFetchRuleExpander.Key)] IFetchRuleExpander fetchRuleExpander) : IFetchService
{
private readonly ConcurrentDictionary<Type, ConcurrentDictionary<Type, object>> rootCache = [];
private readonly ConcurrentDictionary<Type, object> rootCache = [];

public virtual IQueryable<TSource> ApplyFetch<TSource>(IQueryable<TSource> source, FetchRule<TSource> fetchRule)
where TSource : class => this.GetApplyFetchFunc(fetchRule).Invoke(source);
Expand All @@ -20,7 +20,6 @@ private Func<IQueryable<TSource>, IQueryable<TSource>> GetApplyFetchFunc<TSource
where TSource : class
{
return this.rootCache
.GetOrAdd(typeof(TSource), _ => new ConcurrentDictionary<Type, object>())
.GetOrAdd(fetchRule.GetType(), _ => new ConcurrentDictionary<FetchRule<TSource>, Func<IQueryable<TSource>, IQueryable<TSource>>>())
.Pipe(v => (ConcurrentDictionary<FetchRule<TSource>, Func<IQueryable<TSource>, IQueryable<TSource>>>)v)
.GetOrAdd(fetchRule, _ =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class RootFetchRuleExpander(IEnumerable<IFetchRuleExpander> expanders) :
else
{
return cache
.GetOrAdd(typeof(TSource), _ => new ConcurrentDictionary<FetchRule<TSource>, PropertyFetchRule<TSource>?>())
.GetOrAdd(fetchRule.GetType(), _ => new ConcurrentDictionary<FetchRule<TSource>, PropertyFetchRule<TSource>?>())
.Pipe(innerCache => (ConcurrentDictionary<FetchRule<TSource>, PropertyFetchRule<TSource>?>)innerCache)
.GetOrAdd(fetchRule, _ =>
{
Expand Down
2 changes: 1 addition & 1 deletion src/__SolutionItems/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[assembly: AssemblyProduct("GenericQueryable")]
[assembly: AssemblyCompany("IvAt")]

[assembly: AssemblyVersion("2.1.13.0")]
[assembly: AssemblyVersion("2.1.14.0")]
[assembly: AssemblyInformationalVersion("changes at build")]

#if DEBUG
Expand Down
Loading