开发者

XElement.Elements(XName name) doesn't return a name that exists in XElement.Elements()

开发者 https://www.devze.com 2023-01-13 18:24 出处:网络
As you can see, the schema.Elements returns three elements one of whom is an EntityContainer element.

As you can see, the schema.Elements returns three elements one of whom is an EntityContainer element. But when I try to sea开发者_C百科rch thru the Elements overload specifying the "EntityContainer" (schema.<EntityContainer>) it doesn't retrieve anything.

XElement.Elements(XName name) doesn't return a name that exists in XElement.Elements()


Answer found.

It didn't return anything since the EntityContainer element in the edmx file belongs to an imported namespace I forgot to import in my file.

Adding this line solved everything:

Imports <xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号