title: how to delete record on database using breezejs and web api 2?
body: <p>I want to delete record on database using breeze js and web api 2
  this is my code :</p>
  
  <pre><code>materialAdmin
      .controller('schProgCtrl', function ($scope, breeze, $filter, $sce, ngTableParams, serviceUrl, schServiceName) {
          var serviceName = serviceUrl + schServiceName; // route to the Web Api controller
          var manager = new breeze.EntityManager(serviceName);
          $scope.getAll = function (query) {
              var eq = breeze.EntityQuery;
              var query = new eq(query)
              return manager.executeQuery(query);
          };
  
          $scope.update = function (w) {
              if(!w.Id){
                  var type = manager.metadataStore.getEntityType('MD_ScholarshipProgram');
                  var newItem = type.createEntity(w);
                  manager.addEntity(newItem);
              }
              if (manager.hasChanges()) {
                  manager.saveChanges()
                      .then(function (res) {
                          console.log(res);
                      })
                      .catch(function (err) {
                          alerts('Oops!!! Data tidak ter-update ke server.');
                          console.log(err);
                      })
                      .finally(function () {
                          w.$edit = false;
                      });
              } else {
                  alert("Nothing to save");
                  w.$edit = false;
              }
          };
          $scope.addNew = function() {
              $scope.datatable.data.unshift({
                  Name :'',
                  Code : '',
                  $edit : true
              });
          };
          $scope.delete = function (w) {
              console.log(w.entityAspect);
              w.entityAspect.setDeleted();
              manager.saveChanges();
          };
          $scope.datatable = new ngTableParams({
                  page: 1,            // show first page
                  count: 10
              },
              {
                  getData: function ($defer, params) {
                      $scope.getAll({
                          from: "Program",
                          orderBy : ['Code asc'],
                          skip : ((params.page() -1) * params.count()),
                          take : params.count(),
                          inlineCount:true
                      })
                          .then(function (res) {
                              console.log(res);
                              params.total(res.inlineCount); 
                              var data = res.results;
                              $defer.resolve(data);
  
                          });
  
                  }
              });
  
      });
  </code></pre>
  
  <p>I using <code>ngTable</code>.</p>
  
  <p>But i get an error :
  <code>TypeError: Cannot read property 'setDeleted' of undefined</code></p>
  
  <p>may be the way i delete is wrong, how properly delete record using breeze js?</p>