I am using Linq-To-Entity in my project. But, I am hesitating to use Stored Procedure
or LINQ to Table or View
in some situations. But, I generally prefer to use LINQ, because of the pleasent syntax. I have searched google, but not found detailed asnwer to my question.
Let's consider this code:
using (NorthwindEntities db = new NorthwindEntities())
{
var custs = from c in db.Customers where c.City == "London" select c;
var edus = from c in db.Educations where c.Education != "2" select c;
// ... and so on
}
Questions:
1. Does it open a new connection for each query? If it does, then it is not adviced to use above queries seperately?
2. Also, could you advice me is there any situations that I must use Stored Procedure instead of LINQ?