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

Invalid backend error

2 Answers 24 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Javierdj
Top achievements
Rank 2
Javierdj asked on 06 May 2016, 05:28 PM

I'm having the following problem loading the configuration file via BackendConfiguration. I recieve the error:"Invalid backend". Can anyone help me?

Config File:

<configSections>
<section name="openAccessConfiguration" type="Telerik.OpenAccess.Config.OpenAccessConfigSectionHandler, Telerik.OpenAccess" requirePermission="false" />
</configSections>
 
<openAccessConfiguration xmlns="http://www.telerik.com/OpenAcessConfiguration">
<backendConfiguration name="CreditosPreaprobadosConfiguration" connectionTimeout="134" />
</openAccessConfiguration>

Context Class:

using System;
    using System.Linq;
    using Telerik.OpenAccess;
    using Telerik.OpenAccess.Metadata;
 
    public partial class CreditosPreaprobadosContext : OpenAccessContext
    {
        private static MetadataContainer metadataContainer = new CreditosPreaprobadosMetadataSource().GetModel();
        private static BackendConfiguration backendConfiguration = GetBackendConfiguration();
 
        public CreditosPreaprobadosContext(string dbConnection) : base(dbConnection, backendConfiguration, metadataContainer)
        {
        }
 
        public IQueryable<TipoCanales> TipoCanales
        {
            get
            {
                return this.GetAll<TipoCanales>();
            }
        }
 
        /// <summary>
        /// Devuelve un objeto <see cref="BackendConfiguration"/>
        /// </summary>
        /// <returns></returns>
        public static BackendConfiguration GetBackendConfiguration()
        {
           BackendConfiguration backendConfiguration = new BackendConfiguration()
            {
                Backend = "CreditosPreaprobadosContext"
            };
 
           BackendConfiguration.MergeBackendConfigurationFromConfigFile(backendConfiguration, ConfigurationMergeMode.ConfigFileDefinitionWins, "CreditosPreaprobadosConfiguration");
 
           return backendConfiguration;
        }
    }

2 Answers, 1 is accepted

Sort by
0
Boris Georgiev
Telerik team
answered on 11 May 2016, 12:25 PM
Hello Javier,

Unfortunately the code snippets which you had sent are not enough to investigate the issue. Although in the config file snippet is missing the "backend" property in the backend configuration, could you try to add it and see if the issue will exists after that? For more information how to configure the OpenAccessContext via Config File you could refer to this documentation article.

If the issue still exists could you send us the entire config file and the context class?

I am looking forward to hearing from you.

Regards,
Boris Georgiev
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
0
Javierdj
Top achievements
Rank 2
answered on 12 May 2016, 02:07 PM
Boris from Telerik help to solve the problem is missing the "backend" property in the backend configuration. Thanks a lot!!!!
Tags
Development (API, general questions)
Asked by
Javierdj
Top achievements
Rank 2
Answers by
Boris Georgiev
Telerik team
Javierdj
Top achievements
Rank 2
Share this question
or