C# Class NJsonApi.Serialization.TransformationHelper

Show file Open project: jacek-gorgon/NJsonApi Class Usage Examples

Public Methods

Method Description
AppendIncludedRepresentationRecursive ( object resource, IResourceMapping resourceMapping, List includedList, HashSet alreadyVisitedObjects, Context context ) : void
AssureAllMappingsRegistered ( Type type, Configuration config ) : void
ChooseProperResourceRepresentation ( object resource, IEnumerable representationList ) : IResourceRepresentation
CreateIncludedRepresentations ( List primaryResourceList, IResourceMapping resourceMapping, Context context ) : List
CreateRelationships ( object objectGraph, string parentId, IResourceMapping resourceMapping, Context context ) : IRelationship>.Dictionary
CreateResourceRepresentation ( object objectGraph, IResourceMapping resourceMapping, Context context ) : SingleResource
GetCollection ( JToken value, IRelationshipMapping mapping ) : object
GetMetadata ( object objectGraph ) : object>.Dictionary
GetObjectType ( object objectGraph ) : Type
GetValue ( JToken value, Type returnType ) : object
HandleException ( Exception exception ) : CompoundDocument
HandleHttpError ( HttpError error ) : CompoundDocument
UnifyObjectsToList ( object nestedObject ) : List
UnwrapResourceObject ( object objectGraph ) : object
VerifyTypeSupport ( Type innerObjectType ) : void

Private Methods

Method Description
CreateLinks ( IResourceMapping resourceMapping, UrlBuilder urlBuilder, SingleResource result ) : ILink>.Dictionary
GetUrlFromTemplate ( string urlTemplate, string routePrefix, string parentId, string relatedId = null ) : ILink

Method Details

AppendIncludedRepresentationRecursive() public method

public AppendIncludedRepresentationRecursive ( object resource, IResourceMapping resourceMapping, List includedList, HashSet alreadyVisitedObjects, Context context ) : void
resource object
resourceMapping IResourceMapping
includedList List
alreadyVisitedObjects HashSet
context Context
return void

AssureAllMappingsRegistered() public method

public AssureAllMappingsRegistered ( Type type, Configuration config ) : void
type System.Type
config Configuration
return void

ChooseProperResourceRepresentation() public method

public ChooseProperResourceRepresentation ( object resource, IEnumerable representationList ) : IResourceRepresentation
resource object
representationList IEnumerable
return IResourceRepresentation

CreateIncludedRepresentations() public method

public CreateIncludedRepresentations ( List primaryResourceList, IResourceMapping resourceMapping, Context context ) : List
primaryResourceList List
resourceMapping IResourceMapping
context Context
return List

CreateRelationships() public method

public CreateRelationships ( object objectGraph, string parentId, IResourceMapping resourceMapping, Context context ) : IRelationship>.Dictionary
objectGraph object
parentId string
resourceMapping IResourceMapping
context Context
return IRelationship>.Dictionary

CreateResourceRepresentation() public method

public CreateResourceRepresentation ( object objectGraph, IResourceMapping resourceMapping, Context context ) : SingleResource
objectGraph object
resourceMapping IResourceMapping
context Context
return NJsonApi.Serialization.Representations.Resources.SingleResource

GetCollection() public method

public GetCollection ( JToken value, IRelationshipMapping mapping ) : object
value JToken
mapping IRelationshipMapping
return object

GetMetadata() public method

public GetMetadata ( object objectGraph ) : object>.Dictionary
objectGraph object
return object>.Dictionary

GetObjectType() public method

public GetObjectType ( object objectGraph ) : Type
objectGraph object
return System.Type

GetValue() public method

public GetValue ( JToken value, Type returnType ) : object
value JToken
returnType System.Type
return object

HandleException() public method

public HandleException ( Exception exception ) : CompoundDocument
exception System.Exception
return CompoundDocument

HandleHttpError() public method

public HandleHttpError ( HttpError error ) : CompoundDocument
error HttpError
return CompoundDocument

UnifyObjectsToList() public method

public UnifyObjectsToList ( object nestedObject ) : List
nestedObject object
return List

UnwrapResourceObject() public method

public UnwrapResourceObject ( object objectGraph ) : object
objectGraph object
return object

VerifyTypeSupport() public method

public VerifyTypeSupport ( Type innerObjectType ) : void
innerObjectType System.Type
return void