Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用Breezejs扩展查询_Breeze - Fatal编程技术网

用Breezejs扩展查询

用Breezejs扩展查询,breeze,Breeze,我正在向服务器发送带有展开的查询 var query = breeze.EntityQuery.from("Incidents") .expand("IncidentComments") .where("IncidentID", "eq", incidentId); 在http中,我得到的结果是确定的,实体与相关实体 当我从breeze中的查询返回时,我是如何看不到数据的 附带评论没有评论 func

我正在向服务器发送带有展开的查询

var query = breeze.EntityQuery.from("Incidents")
                        .expand("IncidentComments")
                        .where("IncidentID", "eq", incidentId);
在http中,我得到的结果是确定的,实体与相关实体 当我从breeze中的查询返回时,我是如何看不到数据的 附带评论没有评论

function getSucceeded(data) {
        $scope.incident = data;
        $scope.incidentComments = data.IncidentComments;
    }
假设“IncidentComments”是“Incident”的一个属性,那么这些评论将被返回。因此:

var query = breeze.EntityQuery.from("Incidents")
                    .expand("IncidentComments")
                    .where("IncidentID", "eq", incidentId);
var myEntityManager.executeQuery(query).then(function (data) {
   var incidents = data.results;
   var incident = incidents[0]; // because you are only returning one incident;
   var incidentComments = incident.incidentComments; 
});

我已经在做了,我的感觉是它在edm中,但我不知道是什么,我正在使用webapi odata作为服务器端