I want to convert the code select
to a query LINQ
SELECT bpac.cmp FROM bpac
union
SELECT bpai.cmp FROM bpai
group by cmp
order by cmp desc
I'm trying to get the first table and I'm already getting error:
List<string> listaBpac = modelOff.bpacs.Where(p => p.ibge == oUsuario.ibge)
.Select(p => new { p.cmp })
.ToList();
can not implicitly convert type 'system.collections.generic.list "anonimous type: string cmp"' to 'system.collections.generic.list "anonimous type: string"'