I have a SQL view that I want to use and put it into a C# list into an ASP.NET MVC project so that I can execute a query on that list. The problem is that I get wrong data from the view.
When I try to get all the data from the SQL view, the count is correct but some rows are shown multiple times and some are simply gone. Same thing happens when I try go execute some logic on the data from that view.
[HttpGet]
[Route("Home/Testing/{godina}/{istorija}/{decursus_id}/{therapy_id}")]
public ActionResult Testing(string godina, string istorija, int decursus_id, string therapy_id)
{
List<v_as_stac_terapija_komercijalni> terapijaKomercijalniList = db.v_as_stac_terapija_komercijalni
.Where(x => x.godina == godina
&& x.istorija == istorija
&& x.decursus_id == decursus_id
&& x.therapy_id == therapy_id)
.ToList();
return View();
}
So according to the data in my SQL view and according to the parameters given in this action, the list should hold 3 results, and the count is 3 but the problem is I always get the first record that matches this parameters 3 times, instead of getting the real 3 records.
I can provide additional information if necessary. Thanks