0

I'm not using EF, so have followed the NoDb sample to successfully load data from my WebApi without using the server side metadata. After the initial load, I was hoping to use the local data cache in the EntityManager while the user interacts with the page. The problem is when I call executeQueryLocally, the cached data set is empty. I stepped through the code to see why the data wasn't being saved to the cache, and there were two issues:

  1. in _getEntityType, metadataStore.isEmpty() was returning true.
  2. in _getEntityType, metadataStore._getEntityTypeNameForResourceName was returning nothing

To get around the this, I added calls in my code to metadataStore.addDataService and metadataStore._setEntityTypeForResourceName. After adding these, the cache was saved properly and executeQueryLocally worked. I'm assuming this was not the intended way to get this to work... Is there something else I am doing wrong? Or is this a bug that can be fixed?

4

1 回答 1

0

很抱歉花了这么长时间才回到这个。

我们刚刚在微风 v.1.1.3 中公开了 metadataStore.setEntityTypeForResourceName。(我们重命名了删除第一个“_”的方法。

否则,你做了完全正确的事。接得好。

于 2013-03-05T01:35:14.183 回答