BinaryStudio.TaskManager.Logic.Core.HumanTaskRepository.GetAllHistoryForUser C# (CSharp) Метод

GetAllHistoryForUser() публичный Метод

public GetAllHistoryForUser ( int userId ) : IList
userId int
Результат IList
        public IList<HumanTaskHistory> GetAllHistoryForUser(int userId)
        {
            var projects = this.dataBaseContext.Users.First(x => x.Id == userId).UserProjects;
            var taskHistories = new List<HumanTaskHistory>();
            foreach (var project in projects )
            {
                foreach (var task in project.Tasks)
                {
                    taskHistories.AddRange(GetAllHistoryForTask(task.Id));
                }
            }
            return taskHistories;
        }