I have an SQL query within ASP.NET, but it only seems to return 1 result rather than filling the list with 4 as it should (as the query itself is correct)
Code:
List<string> dropItems, dropItems2;
using (var dbContext = new DatabaseContext())
{
dropItems = dbContext.Database.SqlQuery<String>(
String.Format("SELECT locations.Code FROM locations")).ToList();
}
using (var dbContext = new DatabaseContext())
{
dropItems2 = dbContext.Database.SqlQuery<String>(
String.Format("SELECT locations.Name FROM locations")).ToList();
}
After the code executes, each list only contains one item rather than 4 which they both should