Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
8
Answers
How to convert one list to multidimensional array?
BKS Saha
7y
204
1
Reply
public
JsonResult AllListofMainDivisionDesignation() {
List<HrDesignation> designation =
new
List<HrDesignation>();
var designationgroup = db.HrDesignationGroup.Where(p=>p.Rank==2).ToList();
foreach
(var des
in
designationgroup)
{ var desig = db.HrDesignation.Where(i=> i.DesignationGroupId == des.DesignationGroupId).OrderBy(r => r.Rank).ToList();
designation.AddRange(desig);}
HrDesignation[][] arrays = designation.Select(a =>a.ToArray()).ToArray();
return
Json(arrays, JsonRequestBehavior.AllowGet);
}
Post
Reset
Cancel
Answers (
8
)
Next Recommended Forum
How to fix sanitize the parameters of SqlCommand?
how to put label and textbox inside nested grid in c# ASP??