I currently have a solutuion with two projects.
a blank project called domain which has the ef installed etc.
Now I have a c# form project that makes use of the domain project.
When I make calls to the domain project from teh forms I get the following error:
Additional information: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Do I need to install EF on the form project?
Here is a class in my Domain Project:
/// <summary>
/// Provides Operations to the databse regarding all Service History Requests
/// </summary>
public class EFServiceStatusHistoryRepository
{
public void SubmitEntry(int ServiceId, string Status, string Messages, DateTime LastUpdated)
{
try
{
ServiceStatusHistory tmp = new ServiceStatusHistory();
using (var db = new EFDbContext())
{
tmp.Service = db.Services.Find(ServiceId);
tmp.Status = (ServiceStatus)Enum.Parse(typeof(ServiceStatus), Status);
tmp.SetMessages(Messages);
tmp.time = DateTime.Now;
tmp.LastUpdateTime = LastUpdated;
db.ServiceStatusHistory.Add(tmp);
db.SaveChanges();
}
}
catch
{
}
}
}
And I then call it in the forms project:
EFServiceStatusHistoryRepository service = new EFServiceStatusHistoryRepository();
service.SubmitEntry(bla,bla,bla);
it was my understanding that only the DOMAIN project needed EF installed. as the function I am calling does all the EF work in that project and then returns a List to the forms project?