0
kicks
LINQ to SQL NullReferenceException gotcha
In my DAL (Data Access Layer) assembly (a LINQ-to-SQL centric assembly) I used to insert object into the database like this
public void CreateMessage(MyApp.Entities.Message message)
{
Message m = new Message(); // this is the LINQ-to-SQL generated Message class not the business entity class
m.UserId = message.UserId;
//... set all the properties accordingly
DataContext ctx = new DataCo...