Dovydas Navickas
Dovydas Navickas

Reputation: 3591

String ID in OData

Is there any way to use string ids in OData?

For example, if I have user entity, I would like to have ids like this:

"users/1"
"users/123"
etc...

Am I limited by the protocol or I just cannot make it work with WCF?

For now, I m facing problem with get entity by id:

/DataService.svc/Users('users/1')

as it raises an error.

Upvotes: 0

Views: 103

Answers (1)

Vitek Karas MSFT
Vitek Karas MSFT

Reputation: 13310

This blog post discusses this at length - but in general it's considered not a good idea as there are security implications.

http://blogs.msdn.com/b/peter_qian/archive/2010/05/25/using-wcf-data-service-with-restricted-characrters-as-keys.aspx

Upvotes: 1

Related Questions