I have a project that works for a single database. Now I need to get it to work with a second (within the same project) that has the same data structure. So I am using the same model and am trying to pass in the Data Connection name upon calling my Data Context Class. Unfortunately I am receiving the following error:
The type String cannot be constructed. You must configure the container to supply this value.
Here is the code that I tried:
public UniversityContext(string context)
: base(context){
}
When I looked for answers I found this answer for that error and it recommends, having a parameter-less constructor as well. I tried that and still the same issue.
Here it is with the parameter-less constructor:
public UniversityContext()
: base("UniversityConnection")
{
}
public UniversityContext(string context)
: base(context)
{
}
In case it matters I am using Unity.