I have created four entities for the board of my company to vote: Board Thread, Board Vote Options, Board Thread Vote, and Board Thread Reply. I have gotten the vote count by joining Board Thread and Board Thread Vote and incrementing through the results to add up the counts. Obviously this is far from efficient especially since I have to add the Reply count as well. Would anyone have a better solution to this? Something similar to SQL join having Count(*).
I am using C# and Microsoft.Xrm.Tooling.Connector.CrmServiceClient to query the CRM. Any suggestions would be greatly appreciated!