Dolittle Documentation

Add a query

Query

Add a Query

Within Read/TodoItem/ create a file called AllAvailableLists.cs with the following content:

using System;
using System.Linq;
using Dolittle.Queries;
using Dolittle.ReadModels;

namespace Read.TodoItem
{
    public class AllAvailableLists : IQueryFor<AvailableLists>
    {
        readonly IReadModelRepositoryFor<AvailableLists> _repositoryForAvailableLists;

        public AllAvailableLists(IReadModelRepositoryFor<AvailableLists> repositoryForAvailableLists)
        {
            _repositoryForAvailableLists = repositoryForAvailableLists;
        }

        // Todo:
        public IQueryable<AvailableLists> Query => _repositoryForAvailableLists.Query;
    }
}

In the next part of the tutorial you learn how to create the Aurelia front-end.