@@ -4,31 +4,23 @@ namespace JsonApiDotNetCore.JsonApi
44{
55 public static class DocumentBuilder
66 {
7- public static Dictionary < string , string > BuildSelfLink ( string protocol , string host , string nameSpace , string modelRouteName , string resourceId )
7+ public static Dictionary < string , string > BuildSelfLink ( string protocol , string host , string nameSpace , string resourceCollectionName , string resourceId )
88 {
99 var id = resourceId != null ? $ "/{ resourceId } " : string . Empty ;
1010 return new Dictionary < string , string >
1111 {
1212 {
13- "self" , $ "{ protocol } ://{ host } /{ nameSpace } /{ modelRouteName } { id } "
13+ "self" , $ "{ protocol } ://{ host } /{ nameSpace } /{ resourceCollectionName } { id } "
1414 }
1515 } ;
1616 }
17- public static Dictionary < string , string > BuildSelfLink ( string nameSpace , string modelRouteName )
18- {
19- return new Dictionary < string , string >
20- {
21- {
22- "self" , $ "/{ nameSpace } /{ modelRouteName } "
23- }
24- } ;
25- }
26- public static Dictionary < string , string > BuildRelationshipLinks ( string protocol , string host , string nameSpace , string modelRouteName , string resourceId , string relationshipName )
17+
18+ public static Dictionary < string , string > BuildRelationshipLinks ( string protocol , string host , string nameSpace , string resourceCollectionName , string resourceId , string relationshipName )
2719 {
2820 return new Dictionary < string , string >
2921 {
30- { "self" , $ "{ protocol } ://{ host } /{ nameSpace } /{ modelRouteName } /{ resourceId } /relationships/{ relationshipName } "} ,
31- { "related" , $ "{ protocol } ://{ host } /{ nameSpace } /{ modelRouteName } /{ resourceId } /{ relationshipName } "}
22+ { "self" , $ "{ protocol } ://{ host } /{ nameSpace } /{ resourceCollectionName } /{ resourceId } /relationships/{ relationshipName } "} ,
23+ { "related" , $ "{ protocol } ://{ host } /{ nameSpace } /{ resourceCollectionName } /{ resourceId } /{ relationshipName } "}
3224 } ;
3325 }
3426 }
0 commit comments