私はDALにLinqtoSQLを使用しており、Webアプリケーションでの静的メソッドの使用についてさまざまなことを聞いています(スレッド化/同時実行性の問題に関して)。現時点では、正常に機能しているように見えるテストDALを作成しました。ただし、静的であるため、作成方法に問題はありますか?
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
}
この方法はWebアプリケーションに適していますか、それとも実稼働環境で問題がありますか?
ありがとう。