1
votes

I used to use GetPortalByAlias function in one of my modules in DNN 6.2.6 and below. Now I find out that in DNN 7 this function has omitted. What's the substitution of this function in DNN 7.02?

Assume that my code is like this:

IDataReader dr = 
    DotNetNuke.Data.DataProvider.Instance().GetPortalByAlias(portalAlias);

When I want to compile the code above in DNN 7 It says:

'DotNetNuke.Data.DataProvider' does not contain a definition for 'GetPortalByAlias' and no extension method.

1

1 Answers

2
votes

Looks like DotNetNuke.HttpModules.UrlRewriteModule uses PortalAliasController.GetPortalAliasInfo to do that. I think, in general, you should shy away from using the data provider methods directly, if you can avoid it (though, in this case, the right API is a little hard to find, and wasn't available on older versions of DNN).