Home
Options

IQDriver : Util.CurrentDataContext

Doing this in a static class (for extensions) works fine with the default LINQ to SQL driver:

public static TypedDataContext Context = (TypedDataContext)Util.CurrentDataContext;

But it fails in the IQDriver with "Cannot convert type 'LINQPad.DataContextBase' to 'LINQPad.User.TypedDataContext'". Is there another way to make this work for static classes without having to resort to "MyExtensions.Context = this" in the query?


Comments

  • Options
    did this for the meantime

    public static TypedDataContext Context =
    new LINQPad.User.TypedDataContext (IQToolkit.Data.DbEntityProvider.From
    ("IQToolkit.Data.Sqlite", connectionString,
    "LINQPad.User.TypedDataContext"));
Sign In or Register to comment.