0
The query works perfectly, but when I include the Getqtdecpossible method that returns an integer, to get the possible amount and not need to make other error queries. What I do wrong?
var fpcpAdd = (from fpp in contexto.FPP
join fpc in contexto.FPC on fpp.fpId equals fpc.fpId
join fpcp in contexto.FPCP on new { fpp.fppId, fpc.ecId }
equals new { fpcp.fppId, fpcp.ecId } into x
from d in x.DefaultIfEmpty()
where (fpp.fpId == fpId &&
fpIds.Contains(fpp.fpId) &&
etIds.Contains(fpp.etId)) &&
ecIds.Contains(fpc.ecId) &&
d == null
select new { fpp.fppId,
fpc.ecId,
Qtdpossible = GetQtdecPossible(fpp.fppId)
}).Distinct().ToList();
LINQ to Entities does not recognize the method 'Int32 Getqtdecpossible(System.Decimal)' method, and this method cannot be Translated into a store Expression.
It is not because in performing the query Linus tries to transform this into a query, and in theory its method is not a query, but a code c#, you know? alternative: restructure your query
– Lucas Miranda
Thank you very much!
– Alexandre Moss