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

Can Anybody tell me what I am doing wrong here?

I am pretty sure I have done what the challenge has asked, at least the first part, but it keeps telling me I am missing some structs?

Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Web;

namespace Treehouse.Models { public class VideoGame { public int Id {get; set;} public string Title {get; set;} public string Description {get; set;} public string Characters[] {get; set;} public string Publisher {get; set;} } }

VideoGame.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;





namespace Treehouse.Models
{
       public class VideoGame 
       {
           public int Id {get; set;}
           public string Title {get; set;}
           public string Description {get; set;}
           public string Characters[] {get; set;}
           public string Publisher {get; set;}
       }
}

1 Answer

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 9,738 Points

Recall your variable typesetting skills, when you create a new variable with an array type, how do you call it?

Like so: type [] variableName.

Look carefully at your code, where do you create you array type, and do you notice anything wrong with it?


If you cannot figure it out, then your solution is:

changing public string Characters[] {get; set;} to public string [] Characters {get; set;}