Can't find VfpEntitySession

Sep 13, 2012 at 10:50 AM
Edited Sep 13, 2012 at 10:52 AM

I'm trying to create a class along the lines of the sample Northwind.cs. My project has the correct DLL references, but the following code is failing because the latest version of LINQToVFP doesn't seem to have VfpEntitySession any more.

// create a session instance to monitor changes.
// The session handles the Unit of Work.
// Using the Provider directly
// would execute table changes immediately
this.session = new VfpEntitySession(this.Provider);

Coordinator
Sep 13, 2012 at 2:21 PM

Your UOW class needs to derive from IQToolkitContrib.DbEntitySessionBase.

Here is an example:

public class Northwind  : IQToolkitContrib.DbEntitySessionBase {
	public Northwind(VfpQueryProvider provider)
		: base(provider) {
	}
   
	public virtual ISessionTable<Customer> Customers {
		get { return this.GetTable<Customer>(); }
	}
}


** Sorry, the LinqToNorthwind example was way out of date.  I updated it to work with the current LINQ to VFP build.