This is a migrated thread and some comments may be shown as answers.

BackendType

7 Answers 73 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
XXXX
Top achievements
Rank 1
XXXX asked on 25 Nov 2011, 04:47 PM

Is there anywhere defined what values are possible for BackendConfiguration.Backend ?

All I found in the documentation was it is of type BackendType but no details.


7 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 25 Nov 2011, 06:20 PM
Hello Bjössi,
Usually you do not have to set the backend type. If you specify a connection string with provider name we can derive the type automatically. The only problematic backend is SqlAzure.

You can have a look on our supported databases list here.

Regards,
Jan Blessenohl
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
XXXX
Top achievements
Rank 1
answered on 28 Nov 2011, 04:26 PM
Thanks for swift response.

I didn't explain well enough that I'm not setting but testing for different backends.
So instead of testing against custom string would it be possible to test against a enum or property.
0
Jan Blessenohl
Telerik team
answered on 28 Nov 2011, 05:01 PM
Hi Bjössi,
You should use Telerik.OpenAccess.Metadata.Backend enumeration and compare it to context.Metadata.BackendType.

Regards,
Jan Blessenohl
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
XXXX
Top achievements
Rank 1
answered on 28 Nov 2011, 06:02 PM
Thanks
 looks like it is exactly what I was looking for.
0
XXXX
Top achievements
Rank 1
answered on 02 Dec 2011, 11:57 AM
It looked good on paper but I didn't find a way to use it in comparison.
But moving forward  on related matter.

I have seen the following code for checking backend
IObjectScope scope = this.GetScope();
if (scope.Database.BackendConfiguration.Backend == "mssql")
{
    // MS SQL specific code here
}

but I noticed a private static field backend of the type BackendConfiguration in the generated Context class.
Could that field be used with in the Context class like this
if (backend.Backend == "mssql"
    // MS SQL specific code here 
}

Wouldn't that be more economic than getting the objectscope each time ?

Thanks inadvance


0
Jan Blessenohl
Telerik team
answered on 02 Dec 2011, 02:50 PM
Hi Bjössi,
The first one is no overhead, the scope is already there. The second one just gives you back what is set in the generated code. If you want to use a different ctor of the context to work with different backends you will not find the truth there.

Regards,
Jan Blessenohl
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
XXXX
Top achievements
Rank 1
answered on 02 Dec 2011, 03:57 PM
Thanks for clearing that up. I hadn't noticed that the GetBackendConfiguration() is returning static design time info.

I hadn't gotten as far as looking into backendtype specific ctors I was just attempting to write code that takes into account that there can be different backendtypes.

Thanks again

Tags
Getting Started
Asked by
XXXX
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
XXXX
Top achievements
Rank 1
Share this question
or