Exposing includes to client over webservice for database queries
I don't think you should add a method for setting includes on the query object. That means your consumers have to know which properties need to be included and which ones don't.

I think you should be explicit about it on the query. One approach could be to simply add a property:

// Slightly odd use of "WithPosts" to make it more comparable.
public class GetCustomerQuery : IQuery&lt;Customer&gt;
{
    public string CustomerId { get; private set; }

    public bool IncludePosts { get; private set; }

    public GetCustomerQuery(string customerId) 
    {
        CustomerId = customerId;
    }

    public GetCustomerQuery WithPosts()
    {
        return new GetCustomerQuery(CustomerId) { IncludePosts = true};
    }
}


You could also leverage some inheritance:

public class GetCustomerWithPostsQuery : GetCustomerQuery
{
    public GetCustomerWithPostsQuery(string customerId) : base(customerId)
    {
    }
}

public class GetCustomerQuery : IQuery&lt;Customer&gt;
{
    public string CustomerId { get; private set; }

    public GetCustomerQuery(string customerId) 
    {
        CustomerId = customerId;
    }

    public GetCustomerWithPostsQuery WithPosts()
    {
        return new GetCustomerWithPostsQuery(CustomerId);
    }
}


Either way:

var customerQueryWithoutPosts = new CustomerQuery("Dennis");
var customerQueryIncludingPosts = new CustomerQuery("Dennis").WithPosts();
// ... profit?


You can then either check the query's IncludePosts property OR have a different handler for the specialised GetCustomerWithPostsQuery query object.