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# 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!