ObjectQuery<T>.SelectValue<TResultType> 方法
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
将查询结果限制为仅包含投影中指定的属性。
命名空间: System.Data.Entity.Core.Objects
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
Public Function SelectValue(Of TResultType) ( _
projection As String, _
ParamArray parameters As ObjectParameter() _
) As ObjectQuery(Of TResultType)
用法
Dim instance As ObjectQuery
Dim projection As String
Dim parameters As ObjectParameter()
Dim returnValue As ObjectQuery(Of TResultType)
returnValue = instance.SelectValue(projection, _
parameters)
public ObjectQuery<TResultType> SelectValue<TResultType>(
string projection,
params ObjectParameter[] parameters
)
public:
generic<typename TResultType>
ObjectQuery<TResultType>^ SelectValue(
String^ projection,
... array<ObjectParameter^>^ parameters
)
member SelectValue :
projection:string *
parameters:ObjectParameter[] -> ObjectQuery<'TResultType>
JScript does not support generic types and methods.
类型参数
- TResultType
由 SelectValue<TResultType>(String, ObjectParameter[]) 方法返回的 ObjectQuery<T> 的类型。
参数
- projection
类型:System.String
投影列表。
- parameters
类型:System.Data.Entity.Core.Objects.ObjectParameter[]
在分析时应在作用域内的一组可选查询参数。
返回值
类型:System.Data.Entity.Core.Objects.ObjectQuery<TResultType>
一个类型与特定投影兼容的新 ObjectQuery<T>。返回的 ObjectQuery<T> 等效于应用了 SELECT VALUE 的原始实例。
异常
例外 | 条件 |
---|---|
ArgumentNullException | projection 为 null 或 parameters 为 null。 |
ArgumentException | projection 为空字符串。 |