I'm new to the Entity Framework and trying to get my head around it but struggling somewhat.
I'm trying to do something basic like the below but it bombs out with a 'Null reference exception - Object reference not set to an instance of an object." when I try and do em.AddToCompanies(c); I'm just not able to debug it to get a decent error. I have manually checked there are no non-nullable fields that need filling in. tried catching an exception but I just get the same.
Can anyone tell me how I debug the Entity framework? I have tried on VS2008 and vs2010 with zero luck.
Company c = new Company(); c.Code = "MyCode"; c.FullName = "test co"; c.IsActive = true; c.Language = "ENG"; em.AddToCompanies(c); em.SaveChanges();