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 trialAmar Resic
2,922 PointsCoding 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?
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
231,198 PointsYou'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.