C# 异常:指定的类型成员';LineColor';在LINQ to实体中不支持
我在使用linq分配字节[]中的值时遇到以下异常 LINQ to实体中不支持指定的类型成员“LineColor”。只支持初始值设定项、实体成员和实体导航属性 下面是代码C# 异常:指定的类型成员';LineColor';在LINQ to实体中不支持,c#,entity-framework,linq,C#,Entity Framework,Linq,我在使用linq分配字节[]中的值时遇到以下异常 LINQ to实体中不支持指定的类型成员“LineColor”。只支持初始值设定项、实体成员和实体导航属性 下面是代码 (from v in _DWEntities.DimScheduleJourneys join od in _DWEntities.OperatingDateVehicleJourneyMappings on v.VehicleJourneyUID equals od.VehicleJourney
(from v in _DWEntities.DimScheduleJourneys
join od in _DWEntities.OperatingDateVehicleJourneyMappings on v.VehicleJourneyUID equals od.VehicleJourneyUID
where od.OperatingDateKey == _operatingDate && (vehicleJourneyUID == null || v.VehicleJourneyUID == vehicleJourneyUID)
&& (v.ScheduleDeparture != null && v.ScheduleDeparture != "" && v.ScheduleArrival != null && v.ScheduleArrival != "")
select new ScheduleJourney
{
VehicleJourneyUID = v.VehicleJourneyUID,
VehicleJourneyID = v.VehicleJourneyID,
TransportMode = v.TransportMode,
JourneyCode = v.JourneyCode == null ? v.VehicleJourneyCode : v.JourneyCode,
DepartureTime = v.ScheduleDeparture,
DirectionID = v.DirectionID,
BlockID = od.BlockId.Value,
BlockNumber = od.BlockNumber,
DutyBoard = od.DutyBoard,
DutyBoardID = od.DutyBoardID,
LineUID = v.LineUId,
LineName = v.LineName,
LineColor = v.LineColor,
//LineColor = v.LineName,
ServiceID = v.ServiceID,
ServiceCode = v.ServiceCode,
OperatorID = v.OperatorId,
OperatorCode = v.OperatorCode,
OperatorName = v.OperatorName,
JourneyPatternUID = v.JourneyPatternUID,
FirstStopPoint = v.FirstStopPoint,
LastStoppoint = v.LastStopPoint,
FirstStopPointName = v.FirstStopPointName,
LastStopPointName = v.LastStopPointName,
EndTime = v.ScheduleArrival,
OperatingDate = od.OperatingDate,
JourneyAccessibility = v.WheelchairAccessible.HasValue ? v.WheelchairAccessible.Value : false,
TenantId = v.TenantId.HasValue ? v.TenantId.Value : new Guid(),
DeadRunStartTime = v.DeadRunStartTime,
DeadRunEndTime = v.DeadRunEndTime,
MarketingName = v.MarketingName,
PrivateCode = v.PrivateCode,
// GarageID = v.GarageID,
GarageCode = v.GarageCode,
IsFrequentService = v.FrequentService.HasValue ? v.FrequentService.Value : false,
FrequentServiceInterval = v.ScheduleFrequency,
Origin = v.Origin,
Destination = v.Destination,
IsMasterJourney = v.IsMasterJourney
});
这里我的线条颜色是byte[]
请帮助解决此异常
提前感谢您能在实体类中发布整个LineColor声明吗?LineColor没有标记为NotMapping,对吗?在sql中,LineColor数据类型为varbinary,实体(C#)类为byte[]。所以每次实体在行颜色中取空值。根据我的RND实体无法获取varbinary数据类型值。我不确定,但由于null Linq无法处理,您可以在实体类中发布整个LineColor声明吗?LineColor未标记为NotMapped,对吗?在sql中,LineColor数据类型为varbinary,实体(C#)类为byte[]。所以每次实体在行颜色中取空值。根据我的RND实体无法获取varbinary数据类型值。我不确定,但由于null,Linq无法处理