📅  最后修改于: 2022-03-11 14:48:46.859000             🧑  作者: Mango
[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);
}