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 trial

C# ASP.NET MVC Basics Modeling and Presenting Data Creating a Data Model

Where 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.

VideoGame.cs
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
Steven Parker
231,269 Points

You'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;}

Ah, that was it. Thanks! I didn't really understand that distinction before.