I'm building an internal administration application and decided to give OpenAccess a try instead of using EntityFramework.
I'm using a MVVM approach and I have one project which contains my view and view-models. I then I have three projects, one for each data context, containing a domain model for OpenAccess which make up my data layer. While each domain model models a unique database these databases have some common tables which are identical across all of the databases (log table).
I have a view where a user is to be displayed various logs in the system. I get a connection string from the user. The connection string could be to any of these databases. My assumption was to take the connection string and open a connection to each of the contexts and query for a table which was unique to that database; the theory being that only the context with the unique table would not fail the query.
This is how I imagined my design. When I put it into practice I am getting an error from one of domain models:
Type is enhanced and registered, but not available from the database class meta data. This can be caused by a wrong connection id or configuration.
Now each domain model is in its own class library separated by assembly and namespace. I have a connectionString node in my app.config, but the connection strings in the configuration are never used when this app is deployed. They're just pointers to shell databases that I use for mapping my schema. When I first started troubleshooting this issue I found that having the same connection string may be the issue.
This doesn't seem to be the problem as I can comment out the checks for the other domains and provide a correct connection string that is for that domain and get the above issue.
I've looked into the multiple domain sources
link but this is for having the models in a single project. I still attempted the suggestions leaving the domain models in their separate class libraries, but I'm still getting the error.
My thought is move to ADO.NET and run the analogous SQL command. This would allow me to check without having to create a connection using OpenAccess but the problem still remains that if I detect the specific context that is giving me the error it still gives me an error even if I haven't attempted a connection to the other contexts.
: contains views and view-models
: data layer for product one; contains a domain model (uniquely named) along with partial classes for the persistent classes
: data layer for product two; contains a domain model (uniquely named) along with partial classes for the persistent classes
Product3DL: data layer for product three; contains a domain model (uniquely named) along with partial classes for the persistent classes
Is there something that I'm blatantly missing here?