Заглавная страница Избранные статьи Случайная статья Познавательные статьи Новые добавления Обратная связь FAQ Написать работу КАТЕГОРИИ: АрхеологияБиология Генетика География Информатика История Логика Маркетинг Математика Менеджмент Механика Педагогика Религия Социология Технологии Физика Философия Финансы Химия Экология ТОП 10 на сайте Приготовление дезинфицирующих растворов различной концентрацииТехника нижней прямой подачи мяча. Франко-прусская война (причины и последствия) Организация работы процедурного кабинета Смысловое и механическое запоминание, их место и роль в усвоении знаний Коммуникативные барьеры и пути их преодоления Обработка изделий медицинского назначения многократного применения Образцы текста публицистического стиля Четыре типа изменения баланса Задачи с ответами для Всероссийской олимпиады по праву Мы поможем в написании ваших работ! ЗНАЕТЕ ЛИ ВЫ?
Влияние общества на человека
Приготовление дезинфицирующих растворов различной концентрации Практические работы по географии для 6 класса Организация работы процедурного кабинета Изменения в неживой природе осенью Уборка процедурного кабинета Сольфеджио. Все правила по сольфеджио Балочные системы. Определение реакций опор и моментов защемления |
From, let, where, join and orderby clausesСодержание книги
Поиск на нашем сайте
A query expression with a second from clause followed by a select clause from x1 in e1 is translated into (e1). SelectMany(x1 => e2, (x1, x2) => v) A query expression with a second from clause followed by something other than a select clause: from x1 in e1 is translated into from * in (e1). SelectMany(x1 => e2, (x1, x2) => new { x1, x2 }) A query expression with a let clause from x in e is translated into from * in (e). Select (x => new { x, y = f }) A query expression with a where clause from x in e is translated into from x in (e). Where (x => f) A query expression with a join clause without an into followed by a select clause from x1 in e1 is translated into (e1). Join(e2, x1 => k1, x2 => k2, (x1, x2) => v) A query expression with a join clause without an into followed by something other than a select clause from x1 in e1 is translated into from * in (e1). Join( A query expression with a join clause with an into followed by a select clause from x1 in e1 is translated into (e1). GroupJoin(e2, x1 => k1, x2 => k2, (x1, g) => v) A query expression with a join clause with an into followed by something other than a select clause from x1 in e1 is translated into from * in (e1). GroupJoin( A query expression with an orderby clause from x in e is translated into from x in (e). If an ordering clause specifies a descending direction indicator, an invocation of OrderByDescending or ThenByDescending is produced instead. The following translations assume that there are no let, where, join or orderby clauses, and no more than the one initial from clause in each query expression. The example from c in customers is translated into customers. The example from c in customers is translated into from * in customers. the final translation of which is customers. where x is a compiler generated identifier that is otherwise invisible and inaccessible. The example from o in orders is translated into from * in orders. the final translation of which is orders. where x is a compiler generated identifier that is otherwise invisible and inaccessible. The example from c in customers is translated into customers.Join(orders, c => c.CustomerID, o => o.CustomerID, The example from c in customers is translated into from * in customers. the final translation of which is customers. where x and y are compiler generated identifiers that are otherwise invisible and inaccessible. The example from o in orders has the final translation orders. Select clauses A query expression of the form from x in e select v is translated into (e). Select (x => v) except when v is the identifier x, the translation is simply (e) For example from c in customers.Where(c => c.City == “London”) is simply translated into customers.Where(c => c.City == “London”) Groupby clauses A query expression of the form from x in e group v by k is translated into (e). GroupBy (x => k, x => v) except when v is the identifier x, the translation is (e). GroupBy (x => k) The example from c in customers is translated into customers. Transparent identifiers Certain translations inject range variables with transparent identifiers denoted by *. Transparent identifiers are not a proper language feature; they exist only as an intermediate step in the query expression translation process. When a query translation injects a transparent identifier, further translation steps propagate the transparent identifier into anonymous functions and anonymous object initializers. In those contexts, transparent identifiers have the following behavior: · When a transparent identifier occurs as a parameter in an anonymous function, the members of the associated anonymous type are automatically in scope in the body of the anonymous function. · When a member with a transparent identifier is in scope, the members of that member are in scope as well. · When a transparent identifier occurs as a member declarator in an anonymous object initializer, it introduces a member with a transparent identifier. In the translation steps described above, transparent identifiers are always introduced together with anonymous types, with the intent of capturing multiple range variables as members of a single object. An implementation of C# is permitted to use a different mechanism than anonymous types to group together multiple range variables. The following translation examples assume that anonymous types are used, and show how transparent identifiers can be translated away. The example from c in customers is translated into from * in customers. which is further translated into customers. which, when transparent identifiers are erased, is equivalent to customers. where x is a compiler generated identifier that is otherwise invisible and inaccessible. The example from c in customers is translated into from * in customers. which is further reduced to customers. the final translation of which is customers. where x, y, and z are compiler generated identifiers that are otherwise invisible and inaccessible.
|
||||
Последнее изменение этой страницы: 2016-08-10; просмотров: 265; Нарушение авторского права страницы; Мы поможем в написании вашей работы! infopedia.su Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Обратная связь - 3.144.9.82 (0.009 с.) |