- Notifications
You must be signed in to change notification settings - Fork0
Guidance to migrate from earlier versions of JsonApiDotNetCore.
License
json-api-dotnet/MigrationGuide
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository is intended to aid in migrating API projects usingJsonApiDotNetCore from earlier versions.
Therelease notes describe what has changed between versions.But to see the effects, this repository contains an example ASP.NET API project.By comparing the changes between branches in this repo, you can see how this example project was changed to work with the next major version.
The diff for the upgrade of example projectfrom v4.0.0 to v5.0.1 shows how to convert with minimal change in behavior. It includes tests that assert on the response json.
This upgrade should be straightforward in most cases. Notable renames:
| JsonApiDotNetCore v4 | JsonApiDotNetCore v5 |
|---|---|
IResourceContextProvider | IResourceGraph |
ResourceContext | ResourceType |
RelationshipAttribute.Left/RightType | RelationshipAttribute.Left/RightType.ClrType |
ErrorDocument | Document |
AtomicOperationsDocument | Document |
Error | ErrorObject |
The diff for the upgrade of example projectfrom v3.1.0 to v4.0.0 shows how to convert with minimal change in behavior. It includes tests that assert on the response json.
Since v3, a lot of the internal workings have been optimized. Depending on how much custom code you wrote, the next table of renames may help to find back what you need.
| JsonApiDotNetCore v3 | JsonApiDotNetCore v4 |
|---|---|
BaseJsonApiController.GetRelationshipAsync | .GetSecondaryAsync |
BaseJsonApiController.GetRelationshipsAsync | .GetRelationshipAsync |
EntityResourceService | JsonApiResourceService |
IEntityRepository | IResourceRepository |
DefaultEntityRepository | EntityFrameworkCoreRepository |
ResourceDefinition | JsonApiResourceDefinition |
ContextEntity | ResourceContext |
IContextGraph | IResourceGraph |
RequestMiddleware | JsonApiMiddleware |
IQueryParser | IQueryStringReader |
RelationshipAttribute.(Dependent)Type | RelationshipAttribute.RightType |
Constants.ContentType | HeaderConstants.MediaType |
To improve separation of concerns,IJsonApiContext has been refactored and no longer exists.The table below lists which interfaces to inject, in order to obtain the same information.
IJsonApiContext Member | Replacement |
|---|---|
Options | IJsonApiOptions |
ResourceGraph | IResourceGraph |
QuerySet | IEnumerable<IQueryConstraintProvider> |
PageManager | IPaginationContext |
AttributesToUpdate,RelationshipsToUpdate | ITargetedFields |
HasOneRelationshipPointers,HasManyRelationshipPointers | ITargetedFields.Relationships[].GetValue() |
BasePath | IJsonApiRequest.BasePath |
RequestEntity | IJsonApiRequest.(SecondaryResource ?? PrimaryResource) |
DocumentMeta | IResponseMeta |
MetaBuilder | IResourceDefinition.GetMeta() |
IsRelationshipPath | IJsonApiRequest.Kind |
GenericProcessorFactory | IGenericServiceFactory |
About
Guidance to migrate from earlier versions of JsonApiDotNetCore.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.