0

I have to test whether the breeze saveChanges method is working.For that I am trying to pass a json array in the post method of breeze but when I check the post method in controller it says the saveBundle is null. How can I test the saveChanges manually by passing any entities or json object without actually binding to the view?

var SaveBundle = [{}];
var option = new breeze.SaveOptions({ resourceName: 'SaveChanges'})
var manager = new breeze.EntityManager;
var postData = function () {
    return manager.saveChanges(SaveBundle, option)
         .then(saveSucceeded)
         .fail(saveFailed);
};
Jon Kiparsky
  • 7,499
  • 2
  • 23
  • 38
Krishh
  • 1
  • 3

1 Answers1

0

Hi You need to pass Breeze object using fiddler or other tools.

check below simple Example:

This is my Entity :

Class Test{
 public int Id { get; set; }
 public string Name { get; set; }
}

Sample Json String:

{"entities":[{"Id":-1,"Name":"TestName",entityAspect":{"entityTypeName":"Test:#TestProject.Model.Data","defaultResourceName":"Test","entityState":"Added","originalValuesMap":{},"autoGeneratedKey":{"propertyName":"Id","autoGeneratedKeyType":"Identity"}}}],"saveOptions":{}}
Lalji Kanjareeya
  • 135
  • 2
  • 11