LinqToSQL unit test in .NET error
-
I am doing unit testing with .NET 3.5. Our data layer is made up of a LinqToSQL model (Similar to enitity framework). We are creating objects "Person object" based on the search stored procedures of the LinqToSQL model. The stored procedures all get their data from data views. The tables these views are made from have id's but they are not primary identity keys. Now, in my unit testing I get a DataContext object from the LinqToSQL model and call the search methods for the Person object. The bug is that when the dataContext makes the dataContext.SearchPerson(...) call I get an error indicating that the data tables the views are made up from don't have primary identity keys. At this point in our development we can not set the table id's as primary identity keys. Has anyone experenced this type of problem and what is a good solution? Thanks, Steve Holdorf
-
I am doing unit testing with .NET 3.5. Our data layer is made up of a LinqToSQL model (Similar to enitity framework). We are creating objects "Person object" based on the search stored procedures of the LinqToSQL model. The stored procedures all get their data from data views. The tables these views are made from have id's but they are not primary identity keys. Now, in my unit testing I get a DataContext object from the LinqToSQL model and call the search methods for the Person object. The bug is that when the dataContext makes the dataContext.SearchPerson(...) call I get an error indicating that the data tables the views are made up from don't have primary identity keys. At this point in our development we can not set the table id's as primary identity keys. Has anyone experenced this type of problem and what is a good solution? Thanks, Steve Holdorf
I got this one fix. In the LinqToSQL model (vsmdi file) I set the property for the contactId Identity = true. Thanks, Steve Holdorf