Home

some questions

hi

i am new in programming and can ask silly questions, sorry for that (and i have problem with English, so i can write wrong my questions)

i am writing now my own driver for linqpad. And i have some questions:
1) even if i create driver from your example, i get error - unable to cast object of type 'DataContextDriverDemo.Universal.UniversalStaticDriver' to type 'LINQPad.Extensibility.DataContext.DataContextDriver'
what i can do wrong ?
2) in which method is retrieving objects from db ? if i create static driver, then in user assembly in his implementation of DataContext. if i create dynamic, then in method GetSchemaAndBuildAssembly. i am right ?
3) if i want create driver for object database what i must change in your example ? or what i must bear in mind if i want create this driver ?
4) for static driver in user assembly what must be implemented of DataContext. which of methods, property ?

Comments

  • 5) with creating dynamic driver in class TypedDataContext what i must put in it ? all what user can query ? but how it will populated, i can control it ?
  • edited December 2012
    about 1 question - I find my problem: I add file LINQPad.exe into *.lpx

    now I can write my questions more short:

    1) for creating static driver user always mast implement DataContext ? which methods and properties user must implement ?

    2) for static driver needed implementation of TypedDataContext in users assembly ? which methods and properties user must implement ?

    3) for dynamic driver I must myself implement DataContext and TypedDataContext or just TypedDataContext ? which of methods and property I must implement

    4) if i want create driver for object database what i must change in your example ? or what i must bear in mind if i want create this driver ?
  • A static driver must subclass StaticDataContextDriver. At a minimum, you must implement all of the abstract methods. You can override other virtual methods to provide additional features, as described in the documentation.

    The typed data context itself is provided by the end user. It's entirely up to your driver as to what rules it must follow.

    A dynamic driver must subclass DynamicDataContextDriver and again, it must override the abstract methods, including GetSchemaAndBuildAssembly.

    LINQPad normally keeps the query's application domain alive between query runs, and this might be useful with caching and optimization should you be writing a driver for an object database. Other than that, there shouldn't be any special considerations for object databases.
Sign In or Register to comment.