Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesGetPropertyInfo Obsolete in DNN 5?GetPropertyInfo Obsolete in DNN 5?
Previous
 
Next
New Post
10/15/2010 10:07 AM
 
In a compiled DNN module project in VS 2010 I get this warning:

warning BC40000: 'Public Shared Function GetPropertyInfo(objType As System.Type) As System.Collections.ArrayList' is obsolete: 'Obsolete in DotNetNuke 5.0.  Replaced by GetProperties(Of TObject)()

But it's not a straightforward swapout as this property list won't convert implicitly to an ArrayList. Will IDictionary as a type work?

Dim objProperties As IDictionary = Common.Utilities.CBO.GetProperties(Of CHGR_PivotInfo)()
as a replacement for
Dim objProperties As ArrayList = Common.Utilities.CBO.GetPropertyInfo(GetType(CHGR_PivotInfo))

If this is obsolete in DNN 5, is it just an oversight that it ships this way in the DNN 5.5.1 Starter Kit?

Thanks -


pmgerholdt
 
New Post
10/16/2010 2:00 PM
 
CBO.GetPropertyInfo was marked as obsolete in DNN 5.x and although this method may still be called in legacy code to return an ArrayLIst of PropertyInfo objects, it should be replaced in new code by one of the overloads of CBO.GetProperties. Both overloads return a System.Collections.Generic.Dictionary (Of String, PropertyInfo). Although you could assign the results of CBO.GetProperties to an object of type IDictionary, you will then have to type cast each value in the dictionary object to PropertyInfo. Therefore, I would use the following:

Dim objProperties As Dictionary(Of String, PropertyInfo) = Common.Utilities.CBO.GetProperties(Of CHGR_PivotInfo)()

I'm not sure how you are using this method in your code but keep in mind that obtaining a class' properties in this manner requires the use of reflection which is a very expensive process. Depending on you needs, you may want to look into implementing IHydratable and/or IPropertyAccess in your entity classes.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
10/16/2010 9:24 PM
 
Thanks, Bill.

The "obsolete" code exists out of the box in the DNN 5.5.1 starter kit code for compiled module, in both VB and C#.

pmgerholdt
 
New Post
11/20/2010 5:41 PM
 
I have experienced this same error using the latest Starter Kit as of 11/20/2010. Has this been addressed for future releases? Did the IDictionary solution work for you pmrgerholdt? Or did you use GetProperties(Of TObject)()?
 
New Post
12/4/2010 11:39 PM
 
Thanks Bill
This worked for me too. However I had to add a CHGR_PivotInfo Class as well which VS kindly did for me. Otherwise I would been another few hours trying to figure out how to do that. My coding experience is minimal and these forums and people like you have been a great help.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesGetPropertyInfo Obsolete in DNN 5?GetPropertyInfo Obsolete in DNN 5?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out