日期:2014-05-20  浏览次数:20813 次

Linq:非等值左连接
现有两个泛型列表定义如下:
C# code

    public class CarcassLeans
    {
        public long OBS { get; set; }
        public double CarcassWeight { get; set; }
        public double PredictedLiveWeight { get; set; }
        public double CarcassLean { get; set; }
        public double CarcassYield { get; set; }
        public double MatrixValue { get; set; }
        public double TotalFeedCost { get; set; }
        public double Avg_CarcassWeight { get; set; }

        public CarcassLeans()
        {

        }
    }
    public class DM_Matrix
    {
        public int ID { get; set; }
        public double MatrixValue { get; set; }
        public double MinColumn { get; set; }
        public double MaxColumn { get; set; }
        public double MinRow { get; set; }
        public double MaxRow { get; set; }
        public string Packer { get; set; }


        public DM_Matrix()
        {

        }
    }



刚接触Linq不久,对于等值(A.ID equals B.ID)的left join道是可以通过DefaultIfEmpty()得到结果,对于非等值left join不知如何得出呢?还请各位朋友指点,不胜感激!

------解决方案--------------------
cody,我看见你的帖子啦,哈哈
------解决方案--------------------
UP..........