开发者

LINQ DataLoadOptions.loadwith

开发者 https://www.devze.com 2023-01-27 05:32 出处:网络
This is the code I have for loading my data entities. DataLoadOptions dlo = new DataLoadOptions(); dlo.LoadWith<msPlaylistItem>(m => m.tbMedia);

This is the code I have for loading my data entities.

DataLoadOptions dlo = new DataLoadOptions();
dlo.LoadWith<msPlaylistItem>(m => m.tbMedia);
dlo.LoadWith<tbMedia>(a => a.tbArtists);
dlo.LoadWith<msNote>(n => n.t开发者_运维知识库bMedia.msNotes);
db.LoadOptions = dlo;

dlo.LoadWith(n => n.tbMedia.msNotes); This is the line I am having a problem with. This is the error "The expression specified must be of the form p.A, where p is the parameter and A is a property or field member."

What I am trying to do is load the notes that are related to the each tbMedia object.


this is the correct line

dlo.AssociateWith <tbMedia>(t => t.msNotes.Where(n => n.MediaId == n.tbMedia.id));
0

精彩评论

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