Hi @arsar ,
You can create a new model which contains the string List and the Object list, code like this:
public class ResultViewModel
{
public List<string> Message { get; set; }
public List<FirmModels> FirmModels { get; set; }
}
Then modify the GetByKey method as below:
public JsonResult GetByKey(int? id)
{
List<string> message = new List<string>();
message.Add("zone1");
message.Add("zone2");
message.Add("zone3");
var data = (from z in db.FirmModels
where z.FirmId == id
select z).ToList();
var resulemodel = new ResultViewModel();
resulemodel.Message = message;
resulemodel.FirmModels = data;
return Json(resulemodel, JsonRequestBehavior.AllowGet);
}
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion