0

I have a Sql View that we are using with Entity Framework and Ria Services. When I get the view

var _entity = _context.DepthChartViews;

the _entity is always empty and I get this error.

The 'IsPrimary' property on 'DepthChartView' could not be set to a 'String' value. You must set this property to a non-null value of type 'Boolean'.

My view has this set as a bool - my data is either a 1 or a 0 - i dont have this being set anywhere in code - it is always a true / false.

Been debugging this for a bit and cannot seem to find solution.

4

1 回答 1

0

通过 Visual Studio 中的 GUI 工具或在 .edmx 文件 XML 本身中查找 .edmx 中的 IsPrimary 属性。您可以将 GUI 视图设置为还显示实体中的类型和属性名称:这是一个右键单击选项。听起来实体模型出于某种原因认为该属性是一个字符串,因此映射被搞砸了……您需要告诉它它是一个不可为空的布尔值。

于 2012-04-23T04:40:41.143 回答