현재 두 개의 프로젝트가있는 솔루션이 있습니다.
ef가 설치된 domain이라는 빈 프로젝트 등
이제 도메인 프로젝트를 사용하는 ac # 양식 프로젝트가 있습니다.
양식에서 도메인 프로젝트를 호출하면 다음 오류가 발생합니다.
추가 정보 : 고정 이름이 'System.Data.SqlClient'인 ADO.NET 공급자에 대한 Entity Framework 공급자가 없습니다. 공급자가 애플리케이션 구성 파일의 'entityFramework'섹션에 등록되어 있는지 확인합니다. 자세한 내용은 http://go.microsoft.com/fwlink/?LinkId=260882 를 참조하십시오.
양식 프로젝트에 EF를 설치해야합니까?
내 도메인 프로젝트의 클래스는 다음과 같습니다.
/// <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
{
}
}
}
그런 다음 양식 프로젝트에서 호출합니다.
EFServiceStatusHistoryRepository service = new EFServiceStatusHistoryRepository();
service.SubmitEntry(bla,bla,bla);
DOMAIN 프로젝트에만 EF 설치가 필요하다는 것을 이해했습니다. 내가 호출하는 함수로 모든 EF가 해당 프로젝트에서 작동하고 양식 프로젝트에 목록을 반환합니까?
나는 당신이 EF6부터한다고 생각합니다. 나는했다 매우 비슷한 문제를 내가 Nuget를 사용하여 내 프로젝트의 일부 EF를 업데이트 할 때, 몇 일 전.
동일한 질문에 대한 다른 답변은 동일한 결론을 나타냅니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다