
Comment résoudre le problème de connexion entre le projet et bdd

1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Gowtham CpRank #1,552 · 1K reputationPosted Oct 15, 2024, 2:29 AM EDT
Hi,
The issue happens because your view expects a model of type
Stat.Models.IndexViewModel, but it's gettingStat.Models.Situation. To fix it, check your controller and make sure you're passing the correct model. For example:public IActionResult Index() { var model = new Stat.Models.IndexViewModel(); return View(model); }Or, if the view should use
Situation, update the view like this:Just make sure the model type in your controller and view match, and the error should be resolved.
Hope this helps!