I have created a class library which is used to implement the logic of my project but when I try to run my code this error is shown :
Could not load file or assembly EntityFramework ...
I think this error is meaningless because the EF6 has been installed on my Visual Studio 2013.
Inside the app.config I have defined a connection string:
<connectionStrings>
<add name="con0"
connectionString="Persist Security Info=False;Integrated Security=true;Initial Catalog=jasmin;server=(local)"
providerName="System.Data.sqlclient" />
</connectionStrings>
This is my context class:
public class SchoolClassContext : DbContext
{
public SchoolClassContext() : base("name=con0") { }
public DbSet<SchoolClass> SchoolClassCtx;
public DbSet<Teacher> TeacherCtx;
public DbSet<List<Student>> StudentsCtx;
}
This is my method:
public virtual TransActionInfo AddClass()
{
transActionInfo = new TransActionInfo();
classContext = new SchoolClassContext();
var schoolclass = new SchoolClass() {
ClassID = base.ClassID,
Title = base.Title,
Location = base.Location,
Schedule = base.Schedule,
State = base.State,
TTeacher = base.TTeacher,
Students = base.Students
};
try
{
classContext.SchoolClassCtx.Add(schoolclass);
classContext.SaveChanges();
transActionInfo.Status = TransactionStatus.Status.Successful;
transActionInfo.ObjectName = base.GetType().Name;
transActionInfo.ObjectLastState = schoolclass;
transActionInfo.TransactionTime = DateTime.Now;
return transActionInfo;
}
catch(Exception e)
{
transActionInfo.Status = TransactionStatus.Status.Abort;
transActionInfo.Msg = e.ToString();
transActionInfo.TransactionTime = DateTime.Now;
return transActionInfo;
}
}
Any suggestion ?

