DbExpressionBuilder.Select<TProjection> Yöntem

Tanım

Belirtilen giriş kümesi üzerinde belirtilen ifadeyi seçen yeni DbProjectExpression bir oluşturur.

public:
generic <typename TProjection>
[System::Runtime::CompilerServices::Extension]
 static System::Data::Common::CommandTrees::DbProjectExpression ^ Select(System::Data::Common::CommandTrees::DbExpression ^ source, Func<System::Data::Common::CommandTrees::DbExpression ^, TProjection> ^ projection);
public static System.Data.Common.CommandTrees.DbProjectExpression Select<TProjection> (this System.Data.Common.CommandTrees.DbExpression source, Func<System.Data.Common.CommandTrees.DbExpression,TProjection> projection);
static member Select : System.Data.Common.CommandTrees.DbExpression * Func<System.Data.Common.CommandTrees.DbExpression, 'Projection> -> System.Data.Common.CommandTrees.DbProjectExpression
<Extension()>
Public Function Select(Of TProjection) (source As DbExpression, projection As Func(Of DbExpression, TProjection)) As DbProjectExpression

Tür Parametreleri

TProjection

yönteminin projectionsonuç türü.

Parametreler

source
DbExpression

Giriş kümesini belirten bir ifade.

projection
Func<DbExpression,TProjection>

Giriş kümesinin bir üyesine verilen öngörülen ifadenin nasıl türetileceğini belirten bir yöntem. Bu yöntem, Select ile uyumlu olan ve içine çözümlenebilen DbExpressionbir tür örneği üretmelidir. için TProjection uyumluluk gereksinimleri açıklamalarda açıklanmıştır.

Döndürülenler

Seçme işlemini temsil eden yeni bir DbProjectExpression.

Özel durumlar

source veya projection null.

-veya-

sonucu projection null' dır.

Açıklamalar

Select ile uyumlu olmak için, TProjection türünden DbExpressiontüretilmiş veya DbExpression türetilmiş özelliklere sahip anonim bir tür olmalıdır. Aşağıda için TProjectiondesteklenen tür örnekleri verilmiştir:

source.Select(x => x.Property("Name"))  

TProjection , DbPropertyExpression).

source.Select(x => new { Name = x.Property("Name") })  

(TProjection DbExpression türetilmiş özelliğine sahip anonim bir türdür).

Şunlara uygulanır