entity framework 6 - IManifestTokenResolver for Database First Model? -
we need option set providermanifesttoken in code database first model in order override value edmx, defaults "2012" sql server 2012 in our particular case.
what we've tried far: described in this post decorated our context class dbconfigurationtype attribute, our derived class looks same in post.
internal sealed class mydbconfiguration : dbconfiguration { public mydbconfiguration() { //this.adddependencyresolver(new singletondependencyresolver<imanifesttokenresolver>(new manifesttokenservice())); this.setmanifesttokenresolver(new manifesttokenservice()); } }
as can see, tried 2 different things here, adddependencyresolver , setmanifesttokenresolver.
when start application program execution enters constructor of mydbconfiguration - , that's it, dependency resolver itself
internal sealed class manifesttokenservice : imanifesttokenresolver { private const string sqlservermanifesttoken = @"2005"; private static readonly imanifesttokenresolver defaultmanifesttokenresolver = new defaultmanifesttokenresolver(); /// <inheritdoc /> public string resolvemanifesttoken(dbconnection connection) { if (connection sqlconnection) { return sqlservermanifesttoken; } return defaultmanifesttokenresolver.resolvemanifesttoken(connection); } }
is never invoked seems we've reached dead end here. has had same problem , found solution?
Comments
Post a Comment