EntityContainer.TryGetEntitySetByName 方法
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
使用实体集的指定名称返回一个 EntitySet 对象。
命名空间: System.Data.Entity.Core.Metadata.Edm
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
Public Function TryGetEntitySetByName ( _
name As String, _
ignoreCase As Boolean, _
<OutAttribute> ByRef entitySet As EntitySet _
) As Boolean
用法
Dim instance As EntityContainer
Dim name As String
Dim ignoreCase As Boolean
Dim entitySet As EntitySet
Dim returnValue As Boolean
returnValue = instance.TryGetEntitySetByName(name, _
ignoreCase, entitySet)
public bool TryGetEntitySetByName(
string name,
bool ignoreCase,
out EntitySet entitySet
)
public:
bool TryGetEntitySetByName(
String^ name,
bool ignoreCase,
[OutAttribute] EntitySet^% entitySet
)
member TryGetEntitySetByName :
name:string *
ignoreCase:bool *
entitySet:EntitySet byref -> bool
public function TryGetEntitySetByName(
name : String,
ignoreCase : boolean,
entitySet : EntitySet
) : boolean
参数
- name
类型:System.String
要搜索的实体集的名称。
- ignoreCase
类型:System.Boolean
如果执行不区分大小写的搜索,则为 true;否则为 false。
- entitySet
类型:System.Data.Entity.Core.Metadata.Edm.EntitySet%
在此方法返回时,包含一个 EntitySet 对象。 如果不存在实体集,此输出参数将包含 null。
返回值
类型:System.Boolean
如果存在与搜索条件匹配的实体集,则为 true;否则为 false。