View Single Post
  #2 (permalink)  
Old August 25th, 2010, 03:39 AM
samjudson's Avatar
samjudson samjudson is offline
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well you're main problem is that you can't type the following code:

string s = new string();

As there is no constructor for string that takes no parameters.

It may be that you simply remove the " = new ContentType()" from the variable declaration. If you use that variable you will have to check to see if it is null, but other than that you shouldn't have any problems.

Also, it is convention to use "T" as the name of the generic type - this is much shorter and easier to read, and also makes it easier to spot where the generic type is used. ContentType could quite easily be the name of an actual class.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?