public JsonResult ListCompanyRepresentatives(int id)
{
    var party = _partyRepository.GetCompanyById(id);
    var names = from n in party.Representatives
                orderby n.ValidTo, n.RepresentativeParty.DisplayName
                select new 
                {
                    Id = n.Id.ToString(),
                    Name = n.RepresentativeParty.DisplayName,
                    Role = n.Role ?? string.Empty,
                    Context = n.Context ?? string.Empty,
                    ValidFrom = n.ValidFrom.ToShortDateString(),
                    ValidTo = n.ValidTo.ToShortDateString()
                };
 
    var rows = names.ToArray();
   
    var data = new 
    {
        total = rows.Count(),
        page = 1,
        records = rows.Count(),
        rows = rows
    };
 
    return Json(data, JsonRequestBehavior.AllowGet);       
}

相关文章:

  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-05-03
  • 2022-12-23
猜你喜欢
  • 2021-09-05
  • 2021-06-21
  • 2021-11-07
  • 2021-09-01
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案