This project has moved and is read-only. For the latest updates, please go here.

When creating anonymous objects, Id is being populating with the full url (rather than guid)

Aug 14, 2014 at 2:27 PM
Hi there,

I am trying to create an anonymous type through EntitySet<T> collection, however the the Id property in the anonymous object is the fully quailed url rather than the guid (even though I did set [Identifier] attribute correctly).

so when accessing the Id directly through the object:
var temp= unitOfWork.GetRepository<IPerson>().GetAll().First().Id
I am getting the guid as required

but when creating anonymous object by either of the following:
var list = from p in unitOfWork.GetRepository<IPerson>().GetAll()
                           select new { Id = p.Id, FirstName = p.FirstName, LastName = p.LastName };


var list = unitOfWork.GetRepository<IPerson>().GetAll().Select(p => new { Id = p.Id, FirstName = p.FirstName, LastName = p.LastName });
and then accessing the Id:
var temp1= list.First().Id
I am getting the url (

Any ideas how I can avoid it?