I'm trying get data from database in my application,my js code looks like:
$(function () {
$("#getNotices").button().click(function () {
$.get("/Notice/GetItems", function (data, statusText) {
console.log(data);
});
});
});
My controller:
[HttpGet]
public IEnumerable<Notice> GetItems()
{
return db.GetItems();
}
And Method GetItems:
public IEnumerable<Notice> GetItems()
{
return _db.Notices;
}
It always returns:
Tell me please how i can get data, database keeps data i checked,from database? Thanks for your answers!
