Hey,
I'm using Linq to SQL for my DAL and have heard various things about using static methods in a web application (regarding threading/concurrency issues). At the moment, I created a test DAL, which seems to be functioning fine. However, are there any problems with the way I've created it, since it's static?
public static class TestDAL
{
public static bool GetUserAddress(string username)
{
testDBDataContext dbContext = new testDBDataContext();
//Linq code goes here
}
public static void InsertUserNumber(int userID)
{
testDBDataContext dbContext = new testDBDataContext();
//...
dbContext.UserDetails.InsertOnSubmit(nUser);
dbContext.SubmitChanges();
}
//etc... All the methods are created in the same way
}
Is this method fine for a web application, or will there be problems in a production environment?
Thanks.