Code:
List
using (var dbContext = new DatabaseContext())
{
dropItems = dbContext.Database.SqlQuery
String.Format("SELECT locations.Code FROM locations")).ToList();
}
using (var dbContext = new DatabaseContext())
{
dropItems2 = dbContext.Database.SqlQuery
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
F.Y.I - The item I'm always receiving rather than the full 4 is just the last one
Ramesh MaruthiPosted Oct 20, 2014, 2:57 PM
can you try in this way :
using (var dbContext = new DatabaseContext())
{
var dropItems = dbcontext.Database.SqlQuery
var dropItems2 = dbcontext.Database.SqlQuery
}