At the moment I'm using the repository pattern in C# from this blog. The code of the project can be found here.
Now all seems to work, but I've got an Entity Data Model (.edmx) in my project that I would like to use with this code.
At the moment I've got this code:
public UnitTest1()
{
ObjectContextManager.InitStorage(new SimpleObjectContextStorage());
ObjectContextManager.Init("TraceDb", new[] { "Infrastructure.Test" });
repository = new GenericRepository();
}
But this doesn't seem to work, note that schema namespace of the .edmx is "Trace.DAO.Entity". But also with "Infrastructure.Test" which is the namespace of the .Designer.cs of the .edmx the test wont run properly.
Ps. This is the error I get:
Failed TestMethod1 Infrastructure.Test Unable to create instance of class Infrastructure.Test.UnitTest1. Error: System.ArgumentException: No mapping class found!.
Anyone got a solution for my problem or knows how to use an .edmx with this sourcecode?