entitycollection

What's the easiest way to sort an EF4 EntityCollection<T>?

I'd love to add some sorting to an EntityCollection that is bound to an ItemsControl (in xaml). I'd also like to do it as simply as possible. It appears that this is not possible. If I wrap the collection in a "sorted" version of the collection property within the Entity I lose collection change notifications. I can't use a Collectio...

Insert Entity into EntityCollection w/ RIA

Hey there, I've got a one-to-many relationship set up. (Ex. A Person with many Phone Numbers). In my get query i have this.ObjectContext.Person.Include("PhoneNumbers") and the in generated MetaData including public EntityCollection<PhoneNumbers> PhoneNumbers{ get; set; } I have also set up a DTO with this and other properties i need. [...

Query EntityCollection

Hi I've mapped my classes with default EF way, and all my FKs are EntityCollection, so for example Bike.Wheels would be EntityCollection. How do I work with Wheels: I want to retrieve 1st and 2nd wheel? I want to loop through Wheels? I want to get all wheel.Bolts I could not use get/select/[]. Am I missing something? Thanks --M...

Entity Framework - related ICollection getting materialized into HashSet

I use EntityFramework POCO + proxies + lazy loading in my project. Today I was pretty surprized to see that the class Transaction has its related collection Rows materialized into HashSet (instead of EntityCollection). I need EntityCollection for tracking changes in the collection. public class Transaction { public virtual ICollecti...

Linq to entities - how to select entities with a where condition on their entitycollection ?

Hi all, I found several times people asking for the same question but it seems that the answer was never satisfying altough it should be pretty easy (in theory). Here is my question : I have an entity called "Company" inside which I have an entityCollection "Employees" (one to many). I need to retrieve all Companies and for each of the...