I have this function to return the data in JSON, but I can not get it to work in MVC Core.
public ActionResult SalvarItens(string HoraInicio, string HoraFim, bool Seg, bool Ter, bool Qua, bool Qui, bool Sex, bool Sab, bool Dom, bool Fer, int Tipolimite, int Limiteacessos, int HorarioId)
{
var item = new HorariosItens()
{
HoraFim = HoraFim,
HoraInicio = HoraInicio,
Seg = Seg,
Ter = Ter,
Qua = Qua,
Qui = Qui,
Sex = Sex,
Sab = Sab,
Dom = Dom,
Fer = Fer,
Tipolimite = Tipolimite,
Limiteacessos = Limiteacessos,
HorarioId = HorarioId,
};
try
{
_context.HorariosItens.Add(item);
_context.SaveChanges();
}
catch (Exception ex)
{
throw ex;
}
//return Json(new { Resultado = item.Id }, JsonRequestBehavior.AllowGet);
}
This return Json(new { Resultado = item.Id }, JsonRequestBehavior.AllowGet);
does not work in MVC COre, how can I convert it to work?