sql - Linq select returned where clause field -
var abba = (t1 to mdc.table1 in t2 in mdc.table2 equals t2 at t1.id ). Select ID new {T1, T2}. Encodable (); If (A = 1) ABBA = ABBA Where (q = & gt; q.t1.cid == x); Second abba = abba Where (q = & gt; q.t1.cid == y); Var global = ebay Select (q = & gt; new {newname1 = t1fild1, nunam2 = t 2.field2}). ToList ();
I only want to create a list of 2 fields but 2 fields returned and where the segment field.
Profiler View
exec sp_executesql N'SELECT [Extent1]. [Cid] AS [cid], gt; & Gt; & Gt; This is where the segment [extent1] has been entered. [Field 1] AS [Nunam 1], [extant 2]. [Field 2] AS [Numan 2] FOr [DBO]. [Table 1] AS [Extension 1] Inner Join [DBO]. [Table 2] at AS [Extent 2] [Extent 1]. [ID] = [Extension 2]. [Id] WHERE [Extension 1]. [CID] = @ P_LLC__0 ', N' @ P_LLC__0, ', @ P_LLK__0 = 10000
< P> I think I understand your question ... Why is a section included in the generated SQL?
This line will add a section here because it is still making a query worthy expression tree
Abba = abba. Where (q = & gt; q.t1.cid == x);
If you add a telllist () at the end of your query to terminate your query, you will manipulate objects using the linq objects and you will be from SQL After realization, add real objects to memory.
var abba = (t1 to mdc.table1 in t2 at mdc.table2 on t1.id t2. {T1, T2}). ToList ();
Comments
Post a Comment