C# Class ServiceStack.UrlExtensions

Donated by Ivan Korneliuk from his post: http://korneliuk.blogspot.com/2012/08/servicestack-reusing-dtos.html Modified to only allow using routes matching the supplied HTTP Verb
Datei anzeigen Open project: ServiceStack/ServiceStack

Public Methods

Method Description
AsHttps ( this absoluteUrl ) : string
ExpandGenericTypeName ( Type type ) : string
ExpandTypeName ( this type ) : string
GetMetadataPropertyType ( this type ) : string
GetOperationName ( this type ) : string
GetQueryPropertyTypes ( this requestType ) : Type>.Dictionary
HasRequestBody ( this httpMethod ) : bool
ToDeleteUrl ( this requestDto ) : string
ToGetUrl ( this requestDto ) : string
ToOneWayUrl ( this requestDto, string format = "json" ) : string
ToOneWayUrlOnly ( this requestDto, string format = "json" ) : string
ToPostUrl ( this requestDto ) : string
ToPutUrl ( this requestDto ) : string
ToRelativeUri ( this requestDto, string httpMethod, string formatFallbackToPredefinedRoute = null ) : string
ToReplyUrl ( this requestDto, string format = "json" ) : string
ToReplyUrlOnly ( this requestDto, string format = "json" ) : string
ToUrl ( this requestDto, string httpMethod, string formatFallbackToPredefinedRoute = null ) : string

Generate a url from a Request DTO. Pretty URL generation require Routes to be defined using `[Route]` on the Request DTO

Private Methods

Method Description
FindMostSpecificRoute ( IEnumerable routes ) : RouteResolutionResult
GetRoutesForType ( Type requestType ) : List

Method Details

AsHttps() public static method

public static AsHttps ( this absoluteUrl ) : string
absoluteUrl this
return string

ExpandGenericTypeName() public static method

public static ExpandGenericTypeName ( Type type ) : string
type System.Type
return string

ExpandTypeName() public static method

public static ExpandTypeName ( this type ) : string
type this
return string

GetMetadataPropertyType() public static method

public static GetMetadataPropertyType ( this type ) : string
type this
return string

GetOperationName() public static method

public static GetOperationName ( this type ) : string
type this
return string

GetQueryPropertyTypes() public static method

public static GetQueryPropertyTypes ( this requestType ) : Type>.Dictionary
requestType this
return Type>.Dictionary

HasRequestBody() public static method

public static HasRequestBody ( this httpMethod ) : bool
httpMethod this
return bool

ToDeleteUrl() public static method

public static ToDeleteUrl ( this requestDto ) : string
requestDto this
return string

ToGetUrl() public static method

public static ToGetUrl ( this requestDto ) : string
requestDto this
return string

ToOneWayUrl() public static method

public static ToOneWayUrl ( this requestDto, string format = "json" ) : string
requestDto this
format string
return string

ToOneWayUrlOnly() public static method

public static ToOneWayUrlOnly ( this requestDto, string format = "json" ) : string
requestDto this
format string
return string

ToPostUrl() public static method

public static ToPostUrl ( this requestDto ) : string
requestDto this
return string

ToPutUrl() public static method

public static ToPutUrl ( this requestDto ) : string
requestDto this
return string

ToRelativeUri() public static method

public static ToRelativeUri ( this requestDto, string httpMethod, string formatFallbackToPredefinedRoute = null ) : string
requestDto this
httpMethod string
formatFallbackToPredefinedRoute string
return string

ToReplyUrl() public static method

public static ToReplyUrl ( this requestDto, string format = "json" ) : string
requestDto this
format string
return string

ToReplyUrlOnly() public static method

public static ToReplyUrlOnly ( this requestDto, string format = "json" ) : string
requestDto this
format string
return string

ToUrl() public static method

Generate a url from a Request DTO. Pretty URL generation require Routes to be defined using `[Route]` on the Request DTO
public static ToUrl ( this requestDto, string httpMethod, string formatFallbackToPredefinedRoute = null ) : string
requestDto this
httpMethod string
formatFallbackToPredefinedRoute string
return string