public class CellValue
{
public double? Max;
public double? Min;
public string Value;
public string Annotation;
}//以下在數(shù)據(jù)庫中查找是否具有這樣的條件的數(shù)據(jù),如果無返回null
public T GetOne(Expression<Func<T, bool> predicate)
{
IQueryable<T> query = this.context.Set<T>();
return query.FirstOrDefault(predicate);
}我在調(diào)用時總是返回null值,為什么?CellValue cell = new CellValue{Max = 0.8, Min = 0.1, Value="test"};
Steel steel = service.GetOne(t=>t.Max == cell.Max && t.Min == cell.Min && t.Value == cell.Value && t.Annotation == cell.Annotation);//Steel具有和CellValue一樣的屬性,但是返回的steel == null
添加回答
舉報
0/150
提交
取消