On Fri, 2009-03-27 at 20:50 +0100, Giacomo Tesio wrote:
> That said, if the linq datacontext are so hightly coupled with the
> SqlServer ado provider I've no chance to reach this objective as fast
> as I'd hope.
I still don't see how leveraging .NET's DataContext would actually speed
up Mono support, since Mono support would still need to be written, and
using .NET's DataContext would not help in any way...
> But, the IDbConnection in the constructor interface tell me that, at
> least for their mocking requirements, could have lead the microsoft
> programmers to leave a door open.
Not really. IDbConnection has its uses, but it's inadequate for what
needs to be done: translating an expression tree into a SQL statement,
with assistance from vendor-specific code. An additional interface is
required.
Apparently such an interface was actually implemented as well; this post
mentions an IProvider interface:
http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-extensible-linq-to-sql-datacontext.aspx
I do not know why it was not made public.
The above post also mentions what's needed in order to mock DataContext,
which is useful, but to do so requires mucking about in a lot of
internal data, which is a "compatibility requirement" that I would
prefer to not worry about.
> So, if mocking the DataContext is possible, writing such a system that
> from the sqlServer SQL would recreate the linq expression tree (if not
> a simpler one) and use it against another vendor should be possible
> too.
DataContext isn't needed in order to create a LINQ Expression tree. All
that is needed for LINQ Expression tree support is
System.Linq.Queryable, in System.Core.dll. This is not duplicated
within DbLinq.
What DataContext does is turn the expression tree into SQL, a highly
dialect-dependent process (e.g. Queryable.Skip() and Queryable.Take()
have vastly different syntax's between Oracle and MySQL, if you've ever
dealt with LIMIT and the like...).
- Jon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---