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

Amar Resic
Amar Resic
2,732 Points

Coding Challenge help, In VideoGame.cs add a read only property named DisplayText of type string

Not sure why this is wrong, looks just like example from video. When I add readonly after public and before string it gives me a syntax error and it also throws the error "are using the Title followed by publisher in parenthesis Ex. Super Mario 64(Nintendo)." What went wrong?

VideoGame.cs
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; }

    public string DisplayText
        {
            get
            {
                return Title + "(" + Publisher + ")";
            }
        }
    }
}

1 Answer

Steven Parker
Steven Parker
167,904 Points

You're very close! All you need is to add a space between the Title and the open parenthesis to make the returned value conform to the example.