Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNathaniel Moyer
1,254 PointsWhere have I gone wrong? (Bummer! Did you declare a property named 'Id' in VideoGame?)
I've created the requested properties within the VideoGame class, but on submission I'm given the message above. Any help would be appreciated, thanks.
namespace Treehouse.Models
{
public class VideoGame
{
public int Id;
public string Title;
public string Description;
public string[] Characters;
public string Publisher;
}
}
1 Answer
Steven Parker
231,198 PointsYou've declared a collection of public fields with various names and types, but the instructions asked for properties.
For example, the declaration of " a property named Id
of type int
" might look like this:
public int Id {get; set;}
Nathaniel Moyer
1,254 PointsNathaniel Moyer
1,254 PointsAh, that was it. Thanks! I didn't really understand that distinction before.