public class CellValue
{
double? Max;
double? Min;
string Value;
string Annotation;
}
public T GetOne(Expression<Func<T, bool>> predicate)
{
IQueryable<T> query = this.context.Set<T>();
return query.FirstOrDefault(predicate);
}
public class Steel: CellValue{}
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);
//but the object steel is always null. Jush Why?
データベースを確認しましたが、常にnullであることがわかりません。式ツリーとラムダ式が問題である可能性があります。