In such cases, simply the defined order in the DBProviderFactories
configuration could take effect.
Or define custom configuration sections for DBLinq itself to determine
preferred vendor types in order.
An alternative solution is to create a static class to define
the preferred order of vendors (something like
DBLinqConfiguration.PreferredVendors). It could be combined
with configuration settings, and it won't suck for those who
don't like configuration settings.
Though I have to say I do not love my idea. It is sort of hack ;)
Atsushi Eno
Pascal Craponne wrote:
> This is not a tool problem, this is an API problem:
>
> If I want to create a DataContext given a connection string (the worst
> case), how do I know, when I type
> "new DataContext("database=mydb")"
> which DbLinq vendor should be used internally (I assume several vendors
> are already registered, which is not a problem).
>
> Even my solution (exposed a few messages ago), can not solve it in an
> unique way. What if two vendors can handle a given connection string?
>
> On Tue, Oct 7, 2008 at 10:13, Andrus <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
>
> > A better idea, someone?
>
> In entity framework you need to add an entry to machine.config in the
> <DbProviderFactories> section.
>
> For PostgreSQL It should look like this:
>
> <add name="Npgsql Data Provider" invariant="Npgsql"
> description=".Net
> Framework Data Provider for PostgreSQL Server"
> type="Npgsql.NpgsqlFactory,
> Npgsql,
> Version=1.99.2.0 <http://1.99.2.0>, Culture=neutral,
> PublicKeyToken=5d8b90d52f46fda7"/>
>
> Sample edmgen (dbmetal/sqlmetal analoque) to generate the model files:
>
> edmgen.exe /provider:Npgsql /mode:fullgeneration
> /connectionstring:"postgresql
> connection string" /project:ProjectNamespace
>
> Maybe it is possible to use ADO .NET dataprovider factory as shown
> above.
>
> Andrus.
>
>
>
>
>
>
> --
> Pascal.
>
> jabber/gtalk: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> msn: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---