Entity Framework 6 error serverversion : (System.Data.SqlClient.SqlConnection)customerOrderContext.Database.Connection).ServerVersion

.net asp.net-web-api c# entity-framework entity-framework-6

Accepted Answer

Zzz-5-Zzz is the exception, and it occurs when the connection is broken. This is not a problem.

However, because you are merely returning the result and haven't used it, you clearly receive an empty result.new List<BusinessObjects.Customers>() In your approach:

public IEnumerable<BusinessObjects.Customers> GetAllCustomers()
{
    IList<BusinessObjects.Customers> customerCollection = 
        new List<BusinessObjects.Customers>(); // ← An empty list
    dataAccess.CustomerDao.GetAllCustomers();  // ← Just executed but didn't use anywhere
    return customerCollection;                 // ← The empty list you created at first
}

You shouldreturn dataAccess.CustomerDao.GetAllCustomers(); :

6
10/10/2019 9:26:01 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow