开发者

Entity Framework filter nav property with Self Tracking Entities

开发者 https://www.devze.com 2023-01-13 02:02 出处:网络
I\'m using Self Tracking Entities and have a scenario where I have an entity that represents a table that we\'ll call table A. A is a parent to another table B which is also represented as an entity.

I'm using Self Tracking Entities and have a scenario where I have an entity that represents a table that we'll call table A. A is a parent to another table B which is also represented as an entity. On my WinForm I have 3 different binding sources that each represent different types of records from table B but all are children of table A. So what I want to accomplish is use the navigation property for entity/table B to set each binding source

e.g.

bindingSource1.DataSource = A.B.Where(some condition); 
bindingSource2.DataSource = A.B.Where(some other condition);
bindingSource3.DataSource = A.B.Where(another condition);

Ideally, the DataSource for each binding source开发者_如何学Go would be of type TrackableCollection so when I save A, all changes to the 3 filtered instances of B are also saved.

I've tried some different options for this but haven't had any luck so I'm hoping someone else has encountered this same scenario.

Thanks!

0

精彩评论

暂无评论...
验证码 换一张
取 消