爲什麼要將一個字節數組轉換爲可枚舉的float拋出這個錯誤?DbExpression綁定需要輸入表達式
public List<myModel> Get()
{
List<myModel> data;
using (var db = new MyEntities())
{
var query = db.Images.OrderBy(x => x.ID).Select(x => new myModel
{
Id = x.ID,
Name = x.Name,
Bytes = x.Bytes,
BytesToFloat = (IEnumerable<float>)x.Bytes
});
data = query.ToList();
}
return data;
}
public class myModel
{
public int Id{ get; set; }
public string Name { get; set; }
public Byte[] Bytes { get; set; }
public IEnumerable<float> BytesToFloat { get; set; }
}
我收到此錯誤:
{"DbExpressionBinding requires an input expression with a collection ResultType.\r\nParameter name: input"}
x是圖像實體(從SQL Server數據庫映像表)x.Bytes是一個字節] – user1307149 2014-11-06 23:31:32