New Posts New Posts RSS Feed: InitializaDbProvider
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

InitializaDbProvider

 Post Reply Post Reply
Author
dmaya View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Mar-2009
Location: Hostalets de Ba
Posts: 3
Post Options Post Options   Quote dmaya Quote  Post ReplyReply Direct Link To This Post Topic: InitializaDbProvider
    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


Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post 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;
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down