Pergunta : System.InvalidCastException unhandled pelo código de erro do código do usuário em LINQ

pergunta do var = (da ordem em context.MyOrderDetails
onde o userName
do == de order.UserDomainName seleciona o
{
order.AccountID,
order.OrderNumber,
order.OrderStatus,
order.StartDate,
order.EndDate, ordem do
. Publicitário, ordem do
. Campaigne,
order.BookedRevenue,
order.CreativeCount,
order.MissingCreative,
order.MissingCreative,
order.MissingCount,
order.CreativeCount,
order.NotStartedCount,
order.OrderItemActiveCount,
order.OrderItemCompletedCount,
order.OrderItemCount,
order.BookedImpressions,
order.UACount,
order.UAThroughRate,
order.UACPM,
order.UADeliveredImpressionCount,
order.UADeliveredRevenue,
                                     order.UAImpressionGoal,
order.UACount,
order.MissingCount,
order.MissingCreative31to45Count,
order.MissingCreative46to60Count,
order.MissingCreative61to90Count,
order.OrderLifeToDateClickCount,
order.OrderDeliveredImpressionCount,
order.OrderLifeToDateDiscountedSalesUSD,
order.OrderLifeToDateScheduledImpressionCount,
order.ActiveState,
order.OrderProposalExpirationDate,
order.OrderProposalExtensionCount,
order.UAOrderedImpressionCount,
order.UAPacingLTDDeliveredImpressionCount,
order.UAPacingLTDScheduledImpressionCount,
order.UAPacingPct,
order.PremiumLateCreativeCount,
order.PremiumMissingCreative16to30Count,
order.PremiumAssignedCreativeCount,
order.PremiumMissingCreativeCount,
order.PrimaryAeName,
order.UAScheduledImpressionCount,
order.TotalDayCount,
                                     order.UserDomainName, ordem. Filter_OrderGroup do
order.UADeliveredImpressionPercent, do
order.DraftOrderCount, do
order.ProposedOrderCount, do
order.ApprovedOrderCount, do
, ordem. Filter_LineofBusiness do
, ordem. Filter_Status do
, ordem. Filter_ActiveState do
, ordem. Filter_StartdateNext30 do
, ordem. Filter_StartdateNext60 do
, ordem. Filter_StartdateNext90 do
, ordem. Filter_EndDateNext30 do
, ordem. Filter_EndDateNext60 do
, ordem. Filter_EndDateNext90 do
,
order.LineEvent,
order.IsFavorite,
order.ClientID
}) .ToList (); o
It do
dá-me que o o grupo do errors

System.InvalidCastException unhandled pelo code
Message=Unable do usuário para moldar o objeto do tipo “DataServiceOrderedQuery [`65 do <>f__AnonymousType2 [System.String, System. Corda, System.String, 1 do `de System.Nullable [System.DateTime], System. `1 de Nullable [System.DateTime], System.String, System. String, System.Decimal, System. `1 de Nullable [System.Int32], System. `1 de Nullable [System. Int32] , `1 de System.Nullable [System. Int32], `1 de System.Nullable [System.Int32], `1 de System.Nullable [System.Int32], System. `1 de Nullable [System.Int32], System. `1 de Nullable [System. Int32] , `1 de System.Nullable [System. Int32], `1 de System.Nullable [System.Int32], System.Decimal, System.Decimal, `1 de System.Nullable [System.Decimal], System. `1 de Nullable [System. Decimal], `1 de System.Nullable [System.Decimal], System. Decimal, System.Decimal, System. Decimal, `1 de System.Nullable [System.Int32], 1 do `de System.Nullable [System.Int32], System. `1 de Nullable [System.Int32], System. `1 de Nullable [System. Int32], System.Decimal, System.Decimal, System.Decimal, System.Decimal, System.String, 1 do `de System.Nullable [System.DateTime], System. Int32, System.Decimal, System. Decimal, System.Decimal, System. do `1 de Nullable [System.Decimal], `1 de System.Nullable[System. Int32], `1 de System.Nullable [System.Int32], `1 de System.Nullable [System.Int32], System. `1 de Nullable [System.Int32], System. String, System.Decimal, System. Int64, System.String, `1 de System.Nullable [System.Decimal], System. `1 de Nullable [System. Int32] , `1 de System.Nullable [System. Int32], `1 de System.Nullable [System.Int32], System.String, System. String, System.String, System. String, `1 de System.Nullable [System. Byte], `1 de System.Nullable [System.Byte], `1 de System.Nullable [System.Byte], 1 do `de System.Nullable [System.Byte], `1 de System.Nullable [System.Byte], System. `1 de Nullable [System.Byte], System. 1 do `de String, de System.Int32, de System.Nullable [System.Int64]]]” ao tipo “1 do `de System.Data.Services.Client.DataServiceQuery [Microsoft.Advertising.SalesDashboard. Modules. OrderPerformance. Models.OrderPerformance. MyOrderDetails]”.
StackTrace:
em Microsoft.Advertizing.SalesDashboard.Modules.OrderPerformance. Services.
de OrderRepository.<>c__DisplayClass85.erDetailsDrillDown>b__83 (contexto de PerformanceEntities) no `2.<>c__DisplayClass277.

Resposta : System.InvalidCastException unhandled pelo código de erro do código do usuário em LINQ

Algumas perguntas.
Como IMyOrderDetails é definido? É uma classe que você criou?
Você está selecionando todos os campos da tabela MyOrderDetails na cláusula seleta?
Outras soluções  
 
programming4us programming4us