Print Page | Close Window

InitializaDbProvider

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3675
Printed Date: 25-Mar-2025 at 9:31pm


Topic: InitializaDbProvider
Posted By: dmaya
Subject: InitializaDbProvider
Date Posted: 27-Sep-2012 at 7:45am
Hello,

I'm migrating to 2012 and there is a class changed to internal :

        private static void InitializeDbProvider(IDataSourceKey dataSourceKey)
        {

            // If you don't want to directly reference the assembly, you can use reflection to get what
            // you need at run time (the IdeaBlade.EntityModel.Edm assembly is always loaded by the BOS).
            Type t = IdeaBlade.Core.InternalFns.GetIdeaBladeType("IdeaBlade.EntityModel.Edm.EdmKey", true);
            var primer = t.GetProperty("DbConnectionString");
            var edmKey = new EdmKey((ClientEdmKey)dataSourceKey);

it's : IdeaBlade.Core.InternalFns.GetIdeaBladeType

How sould be refactored?

Thank you





Replies:
Posted By: kimj
Date Posted: 27-Sep-2012 at 10:26am
You don't need to use reflection to access these properties on the EdmKey, so you can instead do something like:
 
var edmKey = new EdmKey((ClientEdmKey)dataSourceKey);
var dbConnectionString = edmKey.DbConnectionString;
var providerName = edmKey.DbProviderName;



Print Page | Close Window