равенство с плавающей точкой в ​​запросе linq, где предложение, которое принимает двойной массив - PullRequest
0 голосов
/ 28 мая 2019

Как включить проверку допуска в следующую строку этого запроса linq?

where thicknesses.Contains( mt.Thickness )

где полная функция выглядит следующим образом

    static void fixed_query( string[ ] qualities, string[ ] materials, string[ ] profiles, double[ ] thicknesses ) {

        using ( settingsContext db = new settingsContext() ) {
            var q =
                from s in db.Setting join m in db.Material on s.MaterialId equals m.MaterialId
                join mt in db.MaterialThickness on m.MaterialThicknessId equals mt.MaterialThicknessId
                join cq in db.CutQuality on s.CutQualityId equals cq.CutQualityId
                join mp in db.MaterialProfile on m.MaterialProfileId equals mp.MaterialProfileId
                join type in db.MaterialType on m.MaterialTypeId equals type.MaterialTypeId
                where thicknesses.Contains( mt.Thickness ) &&
                      qualities.Contains( cq.Name ) &&
                      profiles.Contains( mp.Name ) &&
                      materials.Contains( type.Name ) 
                select new { Setting = s, CutQuality = cq };
        }
    }
...