BackendType

8 posts, 0 answers
  1. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 25 Nov 2011 Link to this post


    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.


  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 25 Nov 2011 Link to this post

    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!

  3. DevCraft banner
  4. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 28 Nov 2011 Link to this post

    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.
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 28 Nov 2011 Link to this post

    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!

  6. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 28 Nov 2011 Link to this post

    Thanks
     looks like it is exactly what I was looking for.
  7. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 02 Dec 2011 Link to this post

    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


  8. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 02 Dec 2011 Link to this post

    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!

  9. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 02 Dec 2011 Link to this post

    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

Back to Top
DevCraft banner