我有一個Breeze和Nancy的Angular JS應用程序(Owin自託管)。 我已經想出瞭如何使用Breeze從服務器獲取數據,但是現在我試圖使用Breeze保存更改並且遇到問題。 我見過MVC的例子,如:如何使用Breeze js和Nancy實現SaveChanges
[HttpPost]
public SaveResult SaveChanges(JObject saveBundle)
{
return _repository.SaveChanges(saveBundle);
}
但很明顯,我不能做同樣的南希。我的應用程序發送POST請求的SaveChanges但隨後TypeError: undefined is not a function
和Cannot read property 'map' of undefined
打破此刻,我簡單地返回相同的Json我的請求得到的,因爲我不知道的反應應該是什麼:
Post["/breeze/SaveChanges"] = parameters =>
{
string response = "failed";
try
{
response = new StreamReader(this.Request.Body).ReadToEnd();
}
catch (Exception ex)
{
//TODO handle
}
return Response.AsJson(response);
};
我不確定它是否因爲從服務器接收到不正確的請求或者因爲我沒有正確設置某些東西而中斷。
任何人都可以幫忙嗎?
我試圖返回這個響應,但它並沒有幫助,在接收到任何響應之前和之後的另一個響應之前,錯誤仍然被拋出。我在這裏創建了另一個問題:http://stackoverflow.com/questions/28500013/angularjs-throws-exception-when-trying-to-savechanges-with-breeze我非常感謝,如果你會看看那。謝謝。 – Burjua 2015-02-13 12:52:36