Questions tagged [entitycollection]

41 questions
2
votes
0 answers

Listen to property change through Entity Framework AssociationChanged event

I can successfully listen to changes on Entity Framework child EntityCollection if the action is add or delete but cannot find the way to listen to changes if the child class property value was updated. More specifically, in the below, how can I…
Nuts
  • 2,615
  • 5
  • 28
  • 71
2
votes
2 answers

Returning a collection of objects where an objects property matches any property from another collection of objects using LINQ-to-Entities

I've been searching all day and can't find a solution to this... I have an EntityCollection of Communication objects which each have an instance of an Intention object(one-to-one). I also have a User object which has many instances of UserLocation…
2
votes
1 answer

How to convert IQueryable to EntityCollection

I really cannot find the answer about how to convert IQueryable to EntityCollection? var userGroups = this.ObjectContext.UserGroups; foreach (var userGroup in userGroups ) { var ussers = this.ObjectContext.Users.Where(f => f.UserGroupID ==…
DmitryBoyko
  • 32,983
  • 69
  • 281
  • 458
1
vote
2 answers

How can I use set operations to delete objects in an entitycollection that match a collection of view models?

Here is a very basic example of what I want to do. The code I have come up with seems quite verbose... ie looping through the collection, etc. I am using a Telerik MVC grid that posts back a collection of deleted, inserted and updated ViewModels.…
1
vote
2 answers

Linq to Entities: can't get collection query to work

I'm struggling to get a collection of records using L2E. Here's the model view: http://pascalc.nougen.com/stuffs/aspnet_linq_model2.png I have a user identifier, which is associated to 1 or many UserGroup which themselves are linked to TestCase. I…
user706058
  • 393
  • 3
  • 9
  • 22
1
vote
1 answer

Intersect with 2 EntityCollections via custom IEqualityComparer

Not to repeat this question too much, but I already did a search and came up empty on a result. So I have two EntityCollections of type T and I would like to find the common items in each. The catch? All fields except one must match. So for…
dangerisgo
  • 1,179
  • 3
  • 13
  • 28
1
vote
2 answers

'Contains' method returns false

I've got some strange issue. I've an EntityCollection< T > which contains an element but the Contains method returns false. I've overriden T's 'Equals' method but the 'Contains' method does not call it (while it's said so in documentation). When I…
kra
  • 13
  • 4
1
vote
2 answers

Revert chages in EntityCollection on click of cancel

I have a wpf window wherein grid is bound to entityCollection. herein I add/delete a record to grid and then click cancel button. How can I revert the chages made to the entitycollection.
Rakesh
  • 214
  • 3
  • 18
1
vote
2 answers

Remove Entity from Entitycollection

In a entity collection i have the 4 Entities.Now I need to select the entities by range which means I need to select first two entities. After that I need to remove the first two entities from the entity collection and choose the next two…
User
  • 45
  • 9
1
vote
2 answers

POCO DomainService and Client DomainContext EntityCollections are missing Entities

I have a MainBusinessLine type with an ObservableCollection of type Group, and a method that I call from a DomainService the returns a queryable list of MainBusinessLines. So in this method I have confirmed that all the appropriate Groups are added…
jhorton
  • 909
  • 3
  • 14
  • 31
1
vote
0 answers

Entity Framework: Tracking collection changes in EntityCollection

I'm using entity framework 6 with change tracking and lazy loading enabled, all the properties are virtual to improve change tracking performance (by using self tracking entities), so by default EF creates an EntityCollection to contain…
Filippo Vigani
  • 695
  • 1
  • 6
  • 17
1
vote
1 answer

Query EntityCollection

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…
Massive Boisson
  • 1,587
  • 6
  • 21
  • 28
1
vote
0 answers

Make AutoMapper ignore all my EF-relevant properties (of generic type)

Based on a number of posts here on SO, I am trying to create an extension method for AutoMapper so that for all my EF 4.0 business objects, all the EF-relevant properties of types EntityReference and EntityCollection are excluded from a…
marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
0
votes
1 answer

List to EntityCollection

I've been trying to add some selected items from a multi-select listbox on my entry class. After some research I found that this solution would work: EntityCollection entityCollection = new EntityCollection(); foreach…
eestein
  • 4,354
  • 4
  • 45
  • 83
0
votes
2 answers

Get All Entities From EntityCollection Where Values Matches X

I would like to get all matched Entities from an EntityCollection by a value, but my current statement only allow return of Entity, and not EntityCollection. //only allow return 1 entity var matchedRecords = allRecords.Entities.Where …
gymcode
  • 3,955
  • 13
  • 55
  • 110