è possibile estendere la query-parole chiave di Linq (come: selezionare, dove, ecc.) Con le proprie definizioni?È possibile estendere le parole chiave di ricerca in C#/LINQ?
Codeexample per renderlo più chiaro:
System.Collections.Generic.List<string> aList =
new System.Collections.Generic.List<string> { "aa", "ab", "ba", "bb" };
// instead of
string firstString = (from item in aList
where item.StartsWith("a")
select item).First();
// would be nice
string firstString = from item in aList
where item.StartsWith("a")
selectFirst item;
// or something else
from item in aList
where item.StartsWith("a")
WriteLineToConsole item;
penso che non è possibile, ma ancora sperare;)
Qualsiasi motivo particolare per cui vorresti farlo? – AakashM
Tre utenti da 400K + hanno risposto alla tua domanda. Vai, massacra una capra! – dotNET