public virtual ActionResult GetAllCommission(string searcvalue, int searchTypeid) { var serchtype = (SearchType)(searchTypeid); var commissions = _commissionService.GetCommissionsProfileStudent(searcvalue, serchtype).Item3; var ja = new JArray(); foreach (var itemObject in commissions.Select(item => new JObject { { "Id", item.RequestId }, { "NameFamily", item.Request.Person.Profile.Name + " " + item.Request.Person.Profile.Family }, { "StudentNumber", item.Request.Person.Student.StudentNumber }, { "CommissionSpecialEducations", string.Join(",", item.CommissionSpecialEducations.Select(s => s.SpecialEducation.Name).ToArray()) }, { "VoteText", item.Request.Vote == null ? " " : item.Request.Vote.VoteText }, { "VoteStatus", item.Request.Vote == null ? " " : item.Request.Vote.VoteStatus.GetDescription() } })) { ja.Add(itemObject); } var jo = new JObject { { "total", commissions.Count }, { "rows", ja } }; return(Content(JsonConvert.SerializeObject(jo))); }