I'm using DataServiceContext to load some entity projections (entities have many properties, to minimize traffic I load only those properties, which are needed at the moment) like this:
from x in ctx.Portfolios
select new
{
Id = x.Id,
Name = x.Name,
PortfolioName = x.PortfolioName,
Description = x.Description,
ValidFrom = x.ValidFrom,
ValidUntil = x.ValidUntil
};
What I need is a valid URI of the entity to load it for details view.
I've tried to use ctx.TryGetUri(obj, out uri), but it always returns null (probably because of the non-tracking projections, however, I've loaded the PK property (Id), so it must not be the case).
The question is, how do I determine the URI of the underlying data entity, having a projection object with PK?