Generic CRUD with andgularJs dependency injection

#Controller
public class Result
{
public int Id { get; set; }
public string value { get; set; }
public string info { get; set; }
}
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
[HttpDelete] public ActionResult IndexJsonData(string name)
{
var results = new List()
{
new Result { Id = 1, value = “ABC”, info = “ABC” },
new Result { Id = 2, value = “JKL”, info = “JKL” }
};
return Json(results, JsonRequestBehavior.AllowGet);
}

}

#Index

#Web.config .By default MVC5 does not allow PUT and DELETE request .So Enable it in web.config

Leave a Reply

Your email address will not be published. Required fields are marked *