Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Guidance to migrate from earlier versions of JsonApiDotNetCore.

License

NotificationsYou must be signed in to change notification settings

json-api-dotnet/MigrationGuide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

This repository is intended to aid in migrating API projects usingJsonApiDotNetCore from earlier versions.

How to use

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.

Upgrade from v4 to v5

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 v4JsonApiDotNetCore v5
IResourceContextProviderIResourceGraph
ResourceContextResourceType
RelationshipAttribute.Left/RightTypeRelationshipAttribute.Left/RightType.ClrType
ErrorDocumentDocument
AtomicOperationsDocumentDocument
ErrorErrorObject

Upgrade from v3 to v4

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 v3JsonApiDotNetCore v4
BaseJsonApiController.GetRelationshipAsync.GetSecondaryAsync
BaseJsonApiController.GetRelationshipsAsync.GetRelationshipAsync
EntityResourceServiceJsonApiResourceService
IEntityRepositoryIResourceRepository
DefaultEntityRepositoryEntityFrameworkCoreRepository
ResourceDefinitionJsonApiResourceDefinition
ContextEntityResourceContext
IContextGraphIResourceGraph
RequestMiddlewareJsonApiMiddleware
IQueryParserIQueryStringReader
RelationshipAttribute.(Dependent)TypeRelationshipAttribute.RightType
Constants.ContentTypeHeaderConstants.MediaType

IJsonApiContext replacement

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 MemberReplacement
OptionsIJsonApiOptions
ResourceGraphIResourceGraph
QuerySetIEnumerable<IQueryConstraintProvider>
PageManagerIPaginationContext
AttributesToUpdate,RelationshipsToUpdateITargetedFields
HasOneRelationshipPointers,HasManyRelationshipPointersITargetedFields.Relationships[].GetValue()
BasePathIJsonApiRequest.BasePath
RequestEntityIJsonApiRequest.(SecondaryResource ?? PrimaryResource)
DocumentMetaIResponseMeta
MetaBuilderIResourceDefinition.GetMeta()
IsRelationshipPathIJsonApiRequest.Kind
GenericProcessorFactoryIGenericServiceFactory

About

Guidance to migrate from earlier versions of JsonApiDotNetCore.

Resources

License

Stars

Watchers

Forks

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp