I have some queries that look like this:
public List<AnObjectModel> GetObjectFromDB(TheParameters)
{
using MyDataContext
{
var TheList = (....select new AnObjectModel()...).ToList();
return new List<AnObjectModel>(TheList);
}
}
And they work just fine. My question is this: at the moment, I'm using var and then I'm doing a cast. Would doing this have any performance benefit?
public List<AnObjectModel> GetObjectFromDB(TheParameters)
{
using MyDataContext
{
List<AnObjectModel> TheList = (....select new AnObjectModel()...).ToList();
return TheList;
}
}
It would take me about 20 minutes to make the changes and I'm wondering if there'd be any difference.
Thanks.