Given a People table like this:
+----+------+
| ID | Name |
+----+------+
| 1 | Foo |
| 2 | Bar |
| 3 | Baz |
+----+------+
I'd like to generate c# code like this:
List<People> foo = new List<People>
{
new People{ID = 1, Name = "Foo" },
new People{ID = 2, Name = "Bar" },
new People{ID = 3, Name = "Baz" }
};
The intent is to use the database to easily create large sets of data for unit testing with mock objects.
For clarification, I am using Entity Framework, and I'm using EntityFramework.Testing with Moq to generate mock objects for testing.
Please note that I'm not trying to get an instance of a collection of data from the database, but rather trying to generate an initializer (like above) that can be used as a basis for unit testing without being connected to the database. In other words, the output of whatever tool/process/code you propose should be c# code that represents an object or collection initializer.