I have a solution that has some projects working, they all refer to the Domain layer, which is responsible for connecting to the Oracle Database .
I created a project in Console referencing Domain, like the other projects and when I start the Context I get the following error:
Function evaluation requires all threads to be run.
This in debug when I'm building the instance of OpusDbContext, at the time of starting Database.SetInitializer (null) ;
I put a Try-Cath to see the exception and generated:
InnerException = {"The provider did not return a ProviderManifestToken string."}
Message ="An error occurred while getting provider information from the database." This can be caused by Entity Framework using an incorrect connection string. correct. "
Code
//OpusDbContext esta na minha camada de Domínio
public OpusDbContext()
: base("OpusDbContext")
{
Principal = new OpusPrincipal();
Database.SetInitializer<OpusDbContext>(null);
}
class Program
{
static void Main(string[] args)
{
using (var context = new OpusDbContext())
{
var query = from p in context.Balanca
select p;
var result = query.FirstOrDefault();
Console.WriteLine(result.DescricaoBalanca);
}
Console.ReadKey();
}
}
Where am I going wrong? Any solution?