Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Collections Lists Read-only Collection Interfaces

Eilam Maimoni
PLUS
Eilam Maimoni
Courses Plus Student 9,618 Points

didn't understand what to do

I didn't understand what to do in the challenge

FitnessRecord.cs
using System.Collections.Generic;

namespace Treehouse.CodeChallenges
{
    public class FitnessRecord
    {
        private IReadOnlyList<ActivityEntry> _entries = new List<ActivityEntry>();

        public List<ActivityEntry> Entries { get { return _entries; } }
    }
}
ActivityEntry.cs
using System;

namespace Treehouse.CodeChallenges
{
    public class ActivityEntry
    {
        public string Name { get; set; }
        public DateTime Started { get; set; }
        public DateTime Finished { get; set; }
    }
}

1 Answer

Dave Harker
PLUS
Dave Harker
Courses Plus Student 15,510 Points

Hi Eilam Maimoni

You are so close! It looks like you've got the right idea using IReadOnlyList collection type but you've not assigned it to the public method that the user will call.

I'd suggest changing the _entries assignment back to a List and the Entries into an IReadOnlyList instead :)
Good luck and happy coding,

Dave

Dave Harker
Dave Harker
Courses Plus Student 15,510 Points

Eilam Maimoni — You can mark the question solved by choosing a "best answer".
And happy coding!