次の方法で共有


DbExpressionBuilder.OfTypeOnly メソッド

[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]

指定した型と完全に一致する指定した入力セットの要素で構成されるセットを生成する新しい DbOfTypeExpression を作成します。

名前空間:  System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
アセンブリ:  EntityFramework (EntityFramework.dll 内)

構文

'宣言
<ExtensionAttribute> _
Public Shared Function OfTypeOnly ( _
    argument As DbExpression, _
    type As TypeUsage _
) As DbOfTypeExpression
'使用
Dim argument As DbExpression 
Dim type As TypeUsage 
Dim returnValue As DbOfTypeExpression 

returnValue = argument.OfTypeOnly(type)
public static DbOfTypeExpression OfTypeOnly(
    this DbExpression argument,
    TypeUsage type
)
[ExtensionAttribute]
public:
static DbOfTypeExpression^ OfTypeOnly(
    DbExpression^ argument, 
    TypeUsage^ type
)
static member OfTypeOnly : 
        argument:DbExpression * 
        type:TypeUsage -> DbOfTypeExpression
public static function OfTypeOnly(
    argument : DbExpression, 
    type : TypeUsage
) : DbOfTypeExpression

パラメーター

  • type
    型 : System.Data.Entity.Core.Metadata.Edm.TypeUsage
    入力セットの要素のうち結果のセットに含める要素の型メタデータ。この型と完全に一致した要素だけが結果のセットに含まれます。

戻り値

型 : System.Data.Entity.Core.Common.CommandTrees.DbOfTypeExpression
指定されたセット引数と型、および ExpressionKind の OfTypeOnly を持つ新しい DbOfTypeExpression。

使用上の注意

Visual Basic および Visual C# では、このメソッドを、DbExpression 型のオブジェクトのインスタンス メソッドとして呼び出すことができます。インスタンス メソッド構文を使用してこのメソッドを呼び出す場合は、最初のパラメーターを省略します。詳細については、「https://msdn.microsoft.com/ja-jp/library/bb384936(v=vs.113)」または「https://msdn.microsoft.com/ja-jp/library/bb383977(v=vs.113)」を参照してください。

例外

例外 状態
ArgumentNullException

argument または type が null です。

ArgumentException

argument の結果型がコレクション型でないか、type が属する型階層が、argument のコレクション結果型の要素の型が属する型階層と異なります。

解説

DbOfTypeExpression では、argument の結果型が、ポリモーフィック型の要素を持つコレクション型であり、type で指定される型が、その要素の型と同じ型階層に属している必要があります。

参照

参照

DbExpressionBuilder クラス

System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder 名前空間