samedi 23 janvier 2016

Entity framework in separate dll

I have a class library in which I used entity framework

enter image description here

I added a unit test project to test the DAL dll :

[TestMethod]
public void TestConnection()
{
    try
    {
        ICrud<ajt_demande> dem = new Crud<ajt_demande>();
        List<ajt_demande> lst = (List<ajt_demande>)dem.GetAll();
        Console.WriteLine(lst.Count);
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());
        throw new AssertFailedException();
    }
}

I get an exception indicates that the connection string is not found !!!

I need to know :

  1. What is the reason of this exception?
  2. What is the smarter way to fix this?

Aucun commentaire:

Enregistrer un commentaire