2
所以我有以下代碼:如何將兩個實體框架調用合併爲一個?
var MAX_VOLUME = (from b in context.TRANSPORT_PLANNER_TRACK_CAP.Where(b => b.WAREHOUSE.Equals(warehouse)) select b.MAX_VOLUME).SingleOrDefault();
var MAX_WEIGHT = (from b in context.TRANSPORT_PLANNER_TRACK_CAP.Where(b => b.WAREHOUSE.Equals(warehouse)) select b.MAX_WEIGHT).SingleOrDefault();
string maxVolume = MAX_VOLUME.ToString();
string maxWeight = MAX_WEIGHT.ToString();
我想這兩個語句合併成一個單一的EF電話,以減少冗餘。什麼是最好的方法?