ObjectQuery<T>.Distinct 方法
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
将查询限制为唯一结果。
命名空间: System.Data.Entity.Core.Objects
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
Public Function Distinct As ObjectQuery(Of T)
用法
Dim instance As ObjectQuery
Dim returnValue As ObjectQuery(Of T)
returnValue = instance.Distinct()
public ObjectQuery<T> Distinct()
public:
ObjectQuery<T>^ Distinct()
member Distinct : unit -> ObjectQuery<'T>
public function Distinct() : ObjectQuery<T>
返回值
类型:System.Data.Entity.Core.Objects.ObjectQuery<T>
一个新的 ObjectQuery<T> 实例,等效于应用了 SELECT DISTINCT 的原始实例。