Skip to content

Commit a82aade

Browse files
committed
feat(json-api-context): expose meta builder as a property of the context
1 parent 5545a91 commit a82aade

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/JsonApiDotNetCore/Services/IJsonApiContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using JsonApiDotNetCore.Builders;
23
using JsonApiDotNetCore.Configuration;
34
using JsonApiDotNetCore.Internal;
45
using JsonApiDotNetCore.Internal.Query;
@@ -17,6 +18,6 @@ public interface IJsonApiContext
1718
List<string> IncludedRelationships { get; set; }
1819
bool IsRelationshipPath { get; }
1920
PageManager PageManager { get; set; }
20-
21+
IMetaBuilder MetaBuilder { get; set; }
2122
}
2223
}

src/JsonApiDotNetCore/Services/JsonApiContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ public class JsonApiContext : IJsonApiContext
1414
public JsonApiContext(
1515
IContextGraph contextGraph,
1616
IHttpContextAccessor httpContextAccessor,
17-
JsonApiOptions options)
17+
JsonApiOptions options,
18+
IMetaBuilder metaBuilder)
1819
{
1920
ContextGraph = contextGraph;
2021
_httpContextAccessor = httpContextAccessor;
2122
Options = options;
23+
MetaBuilder = metaBuilder;
2224
}
2325

2426
public JsonApiOptions Options { get; set; }
@@ -30,6 +32,7 @@ public JsonApiContext(
3032
public bool IsRelationshipPath { get; private set; }
3133
public List<string> IncludedRelationships { get; set; }
3234
public PageManager PageManager { get; set; }
35+
public IMetaBuilder MetaBuilder { get; set; }
3336

3437
public IJsonApiContext ApplyContext<T>()
3538
{

0 commit comments

Comments
 (0)