次の方法で共有


ObjectQuery<T>.OfType<TResultType> メソッド

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

特定の型のみが結果となるようにクエリを制限します。

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

構文

'宣言
Public Function OfType(Of TResultType) As ObjectQuery(Of TResultType)
'使用
Dim instance As ObjectQuery 
Dim returnValue As ObjectQuery(Of TResultType)

returnValue = instance.OfType()
public ObjectQuery<TResultType> OfType<TResultType>()
public:
generic<typename TResultType>
ObjectQuery<TResultType>^ OfType()
member OfType : unit -> ObjectQuery<'TResultType> 
JScript does not support generic types and methods.

型パラメーター

  • TResultType
    フィルターを適用してクエリを実行したときに返された ObjectResult<T> の型。

戻り値

型 : System.Data.Entity.Core.Objects.ObjectQuery<TResultType>
OFTYPE が適用された元のインスタンスに相当する、新しい ObjectQuery<T> インスタンス。

例外

例外 状態
EntitySqlException

指定された型が無効です。

参照

参照

ObjectQuery<T> クラス

System.Data.Entity.Core.Objects 名前空間