How to convert an EntityCollection<T> to List<POCOObj>
- by ggomez
I have Entity Framework entities Events which have an EntityCollection of RSVP. I want to convert the EntityCollection of RSVP to a generic List< of a POCO class RSVP.
So I want EntityCollection - List.
What would be the best way to go about achieving this?
So far I have this (it's missing the RSVP part)
var events = from e in _entities.Event.Include("RSVP")
select new BizObjects.Event
{
EventId = e.EventId,
Name = e.Name,
Location = e.Location,
Organizer = e.Organizer,
StartDate = e.StartDate,
EndDate = e.EndDate,
Description = e.Description,
CreatedBy = e.CreatedBy,
CreatedOn = e.CreatedOn,
ModifiedBy = e.ModifiedBy,
ModifiedOn = e.ModifiedOn,
RSVPs = ???
};
Thanks.