One of the main issues was that the query also had to include the owner of the lead. This was a custom field added to the crm. Therefore the XRM file that is used by ADX Studios had to be rebuild with the CrmSvcUtil. I used the following batch file which can be altered depending on your project:
cd\"Program Files (x86)\Adxstudio\XrmPortals\6.0.0009\Framework"
CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /url:https://contoso.com/XRMServices/2011/Organization.svc /username:user /password:password /out:"C:\Xrm.cs" /namespace:Xrm /servicecontextprefix:Xrm /servicecontextname:XrmServiceContext
pause
This must be run as administrator to complete making the new XRM File. That file must then be copied and pasted into the ADX Studio solution. Rebuild the solution and your custom fields will now be used by intellisense when you do your query.
var context = new XrmServiceContext();
var leadList = (from a in context.LeadSet
where a.customFieldOwnerId.Id == Id
select a).ToList().Count();
int count = leadList;
To get a count when using Microsoft Dynamics CRM you must use .ToList() before .Count().
It may seem redundant, but you will get an error if you do not.