多个smallint列上的LINQ联接

本文关键字:LINQ 联接 smallint 多个 | 更新日期: 2023-09-27 17:59:31

我正在连接多个列。如果列类型为int或string等,则没有问题。但我的列类型是smallint。

查询:

    var getworks = (from loc in db.T_location
                            join wl in db.T_vehicle_work_list 
                            on new {x=loc.Route_id, y=loc.Cash_center_num} 
                            equals new { x=wl.Route_id, y=wl.Cash_center_num}
                                        where wl.Route_id == getVehicleRouteId.Route_id && wl.Cash_center_num == getVehicleRouteId.Cash_center_num
                                        && wl.Status_code != "C"
                                        && wl.Instance_id > bfd
                                        && wl.Instance_id < afd
                             select new { loc, wl }).ToList();

错误:"join子句中某个表达式的类型不正确。对'join'的调用中类型推断失败。"

thanx寻求帮助。。。

多个smallint列上的LINQ联接

如果有人也有这个问题。检查模型。edmx列的"nullable"属性与相同