简体   繁体   中英

LinqDataSource Syntax

I have quite a complex LinqDataSource that I'm trying to setup. I've been able to write part of the Linq for it but am unsure how to convert this to LINQDataSource syntax or whether it is even possible. It looks like this.

ConfigDetails.Where (cd => 
AuthProductOwners
   .Where (o => (o.LoginID == @LoginID ))
   .Select (o => o.AuthProductOwnerGroups).Contains(cd.AuthProductOwnerGroups))

The table structure is a AuthProductOwnerGroup can have many ConfigDetails and also many AuthProductOwners.

Thanks

I am not sure I understand your question completely, but I guess you find it difficult to transfer your Linq statement to the datasource. Is that corrrect?

If so: The easiest solution is to create a simple Linq datasource and implement the linqdatasource selecting event and put your query there.

More info: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linqdatasource.selecting.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM