tags:

views:

36

answers:

1

Hi,

In my web app, Subsonic 3.0.0.1 seems to be generating the code from the templates correctly except for two methods: ToString() and DescriptorValue(). And those methods are fine for all the tables but one -- a table named ContentType. That shouldn't be a problem, correct? The error I receive for each of the aforementioned methods is this:

'SubsonicTest.ContentType' does not contain a definition for 'ContentType' and no extension method 'ContentType' accepting a first argument of type 'SubsonicTest.ContentType' could be found (are you missing a using directive or an assembly reference?)

Here are the generated methods that don't build:

public string DescriptorValue() { return this.ContentType.ToString(); }

public override string ToString() { return this.ContentType.ToString(); }

I do of course have a reference to the 3.0.0.1 assembly in my project.

Any ideas?

Thanks,

Richard MCSD.Net, MCTS

+1  A: 

It's because you have two columns in your table, and the second column has the same name as your table. This isn't good naming :) and it's confusing the templates.

Rob Conery