public Document Build(IIdentifiable entity) { var contextEntity = _contextGraph.GetContextEntity(entity.GetType()); var document = new Document { Data = _getData(contextEntity, entity) }; return(document); }
public Document Build(IIdentifiable entity) { var contextEntity = _contextGraph.GetContextEntity(entity.GetType()); var document = new Document { Data = GetData(contextEntity, entity), Meta = GetMeta(entity), Links = _jsonApiContext.PageManager.GetPageLinks(new LinkBuilder(_jsonApiContext)) }; document.Included = AppendIncludedObject(document.Included, contextEntity, entity); return(document); }
public Document Build(IIdentifiable entity) { var contextEntity = _contextGraph.GetContextEntity(entity.GetType()); var document = new Document { Data = GetData(contextEntity, entity, _jsonApiContext.Options.OmitNullValuedAttributesFromResponses), Meta = GetMeta(entity) }; if (ShouldIncludePageLinks(contextEntity)) { document.Links = _jsonApiContext.PageManager.GetPageLinks(new LinkBuilder(_jsonApiContext)); } document.Included = AppendIncludedObject(document.Included, contextEntity, entity); return(document); }
public Document Build(IIdentifiable entity) { var contextEntity = _contextGraph.GetContextEntity(entity.GetType()); var resourceDefinition = _scopedServiceProvider?.GetService(contextEntity.ResourceType) as IResourceDefinition; var document = new Document { Data = GetData(contextEntity, entity, resourceDefinition), Meta = GetMeta(entity) }; if (ShouldIncludePageLinks(contextEntity)) { document.Links = _jsonApiContext.PageManager.GetPageLinks(new LinkBuilder(_jsonApiContext)); } document.Included = AppendIncludedObject(document.Included, contextEntity, entity); return(document); }