使用通用列表,arrayList

时间:2017-12-26 09:15:05

标签: c# class model-view-controller generic-list

我想在功能中填写课程金额。我不知道如何单独添加AmountDetail 我写的代码中有错误。我无法列出Amount类。

var app = angular.module("myApp", []);
      app.run(function($rootScope) {
         $rootScope.userData = {};
         $rootScope.userData.firstName = "Ravi";
         $rootScope.userData.lastName = "Sharma";
      });


      app.controller("firstController", function($scope, $rootScope) {
           console.log($rootScope.userData.firstName)
      });

1 个答案:

答案 0 :(得分:1)

如果你想添加一个详细列表的所有金额列表,那么你可以改变这样的代码,

public class Amount
{
    public int Id{ get; set; }
    public List<AmountDetail> AllList { get; set; }
    public int TotalCount { get; set; }
    public int Top { get; set; }
    public int Page { get; set; }
}

否则你匹配每个detailList - &gt; amountDetail,你应该master-parent id并找到所有linq子查询listamount和两个嵌套for循环并添加detailList。