微风离线模式问题 [英] Breeze Offline Mode Issues

查看:70
本文介绍了微风离线模式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:以下是plnkr来说明问题
http:// plnkr。 co / edit / bwQL3o?p = preview

UPDATE: Here is a plnkr to illustrate the problem http://plnkr.co/edit/bwQL3o?p=preview

Breeze生成 tempKey: EmployeeId:-1 并填充 EmployeeId:-1 的> tempKeys 数组。每件事都是好事。

Breeze generates a tempKey: EmployeeId: -1 and populates a tempKeys array with the EmployeeId: -1. Every thing is all good and great.

因此Breeze加载存储的数据时会看到 EmployeeId:-1 TempKeys 并生成一个新的 EmployeeId:-2
一切仍然美好。

So Breeze loads the stored data sees the TempKeys of EmployeeId: -1 and generates a new EmployeeId: -2 Every thing is still good and great.


  1. 将新数据集存储在本地存储中时, tempKeys
    数组仅包含 EmployeeId:-2 条目。

  2. 稍后,当您导入存储的数据时,尝试创建一个新雇员,您会得到
    的错误:

  1. When you store this new data set in the localstorage the tempKeys array only contains the EmployeeId: -2 entry.
  2. Later on, when you import the stored data and try to create a new Employee you get an Error:




MergeStrategy of'Disallowed '不允许您在已附加具有相同密钥的实体时附加实体

雇员:#Context--1

A MergeStrategy of 'Disallowed' does not allow you to attach an entity when an entity with the same key is already attached: Employee:#Context--1



问题



Breeze为什么不跟踪当前的TempKey?这是错误吗?我们如何解决此方案?任何帮助将不胜感激。

The question

Why is Breeze not keeping track of the current TempKeys? Is this a Bug? How do we fix this Scenario ? Any help would be greatly appreciated.

推荐答案

好吧,这是一个错误,现已在breeze.js存储库中进行了修复。 GitHub。此修复程序还将在Breeze.js的下一个完整版本中发布(可能在下周的某个时候)。 …并感谢您找到此文件并提供了插件。

Ok, this was a bug and has now been fixed in the breeze.js repo on GitHub. This fix will also go out on the next full release of Breeze.js ( probably sometime next week). ... and thanks for finding this and providing the plunkr.

这篇关于微风离线模式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆