I have this constructor that return list of surveys in database
public class SurveysController : Controller
{
private readonly ApplicationDbContext _db;
// GET: Survey/Surveys
public SurveysController(ApplicationDbContext db)
{
_db = db;
}
[HttpGet]
public ActionResult Index()
{
var surveys = _db.Surveys.ToList();
return View(surveys);
}
}
but it gives me error that *No parameterless constructor defined for this object. * Any Help ?!