Breeze not getting metadata automatically

前端 未结 2 1846
耶瑟儿~
耶瑟儿~ 2021-01-25 06:30

The Breeze documentation says:

This [MetadataStore.FetchMetadata] call is made automatically by Breeze just before it attempts to perform

相关标签:
2条回答
  • 2021-01-25 07:02

    I've submitted this bug for Breeze, which addresses this issue:

    $metadata handling: entity types in separate schema from container not supported #96

    I don't think it's correct that Breeze requires the EntityType namespace to match the Schema namespace - I think it's a bug.

    The fix is a 1 line fix, which you can find here: https://github.com/johncrim/breeze.js/commit/9caa76a0de903e08083f600a2a23b9203ef87b49

    You can use https://github.com/johncrim/breeze.js if you like, it only includes that patch on top of the current breeze.js master. But note that it's already 4 commits behind Breeze:master.

    0 讨论(0)
  • 2021-01-25 07:12

    I found the fix for this issue. Breeze is getting the metadata.

    But Breeze has one mostly undocumented OData Requirement that is not part of the OData spec:

    In the metadata the Schema Namespace (found toward the top of the metadata) and the EntitySet EntityType namespace (found under EntityContainer) must be the same.

    Thanks to the Pluralsight course by Brian Noyes for letting me know this.

    NOTE: This is for WCF Data Services version of OData. Your mileage may vary for Web API OData.

    I was able to get this working by making the project that held my Entity Framework model have the same name and namespace as the model's (edmx) namespace.

    You can set the namespace of the edmx via right clicking in the designer and selecting properties (namespace is one of the properties).

    Once I changed my project (and all the files in it) from the name "DataAccess" to the name of my edmx namespace Breeze started working just fine.

    0 讨论(0)
提交回复
热议问题