I am making a query to a table of colonies and returning them in an API in JSON format
colonias = (from c in conn.Colonias
where c.CodigoPostal.Codigo == cp
&& (bool)c.AuActivo
select c).ToList();
return colonias;
if it is returning the colonies:
The problem is that I am including the relations that EF is obtaining from those records:
should I create objects with the results that include only the information I need? or does anyone know a cleaner method?