Answers for "convert list data to json in asp.net mvc"

C#
1

mvc list to jsonresult

[HttpPost]
public JsonResult GetAreasForCompany(int companyId)
{
  var areas = context.Areas
    .Where(x => x.Company.CompanyId == companyId)
    .Select(a => new
    {
      AreaId = a.AreaId,
      Title = a.Title
    });
  return Json(areas);
}
Posted by: Guest on November-05-2020

Code answers related to "convert list data to json in asp.net mvc"

C# Answers by Framework

Browse Popular Code Answers by Language