Hi Ryan.
The trick you need is using the In operator to specify a condition on the Workitem field of the RegularResourceLink.
Here is a sample that should be relevant for your needs. Also note that you can specify Project fields in the Fields collection, though the result will probably give you the project more than once.
EntityQuery eq = new EntityQuery
{
TypeName = "RegularResourceLink",
Where = new Compare
{
LeftExpression = new FieldExpression { FieldName = "Workitem" },
Operator = Operator.In,
RightExpression = new QueryExpression
{
Query = new EntityQuery
{
TypeName = "Task",
Where = new Compare
{
LeftExpression = new FieldExpression { FieldName = "State" },
Operator = Operator.Equal,
RightExpression = new ConstantExpression { Value = new EntityId { TypeName = "State", Value = "Active" } }
}
}
}
},
Fields = new string[] { "WorkItem.Name", "WorkItem.State", "WorkItem.Project.Name" }
};