Hi I am using the ADO.NET entity framework for the first time and the staticcode analysis is suggesting I change the following method to a static one as below.
My question is simple, is this thread safe?
public static void InsertUserDetails(UserAccount userAccount)
{
using (KnowledgeShareEntities entities = new KnowledgeShareEntities())
{
Users user = new Users();
user.usr_firstname = userAccount.FirstName;
user.usr_surname = userAccount.LastName;
user.usr_email = userAccount.Contact.Email;
user.usr_logon_name = userAccount.SAMUserAccountName.ToUpper();
user.usr_last_login_datetime = DateTime.Now;
entities.AddToUsers(user);
entities.SaveChanges();
}
}