in

CodePrairie .NET

South Dakota .NET User Group

chrisortman

UriTemplate and extensions

The UriTemplate is a new class in the .NET Framework 3.5

It provides a nice convenient way to parse variables from Uri's such that

 

UriTemplate temp = new UriTemplate("account/{accountid}");
Uri requestUri = temp.BindByPosition(baseUri, id.ToString());

Will give you http://localhost/account/100 Nice!

 

However, should your template contain a file extension it will give you an exception saying that there are no variables in your template, NOT Nice!

Published Sep 07 2007, 09:01 AM by chrisortman
Filed under:

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
Powered by Community Server (Commercial Edition), by Telligent Systems