I have a MySQL stored procedure selecting data from specific table named tuser
.
I'm using EntityFramework6, so I defined the result of procedure as an entity of tuser
.
When I use the procedure in C# code, the following exception is thrown:
The 'bIsActive' property on 'tuser' could not be set to a 'System.Decimal' value. You must set this property to a non-null value of type 'System.Boolean'.
I cannot understand connection between the action I want to do and exception thrown.
Table definition in Database:
CREATE TABLE `tuser` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sUserName` varchar(45) DEFAULT NULL,
`sUserNameMail` varchar(45) DEFAULT NULL,
`sMail` varchar(45) DEFAULT NULL,
`bIsActive` bit(1) DEFAULT b'1')
ENGINE=InnoDB AUTO_INCREMENT=2225 DEFAULT CHARSET=utf8;
bIsActive definition in ef:
store procedure definition:
CREATE DEFINER=``@`` PROCEDURE `GetActiveUsers`()
BEGIN
select u.* from tuser u
where u.bIsActive=true;
END
error occures when executing following code line:
List<tuser> list = Context.GetActiveUsers().ToList();
inner GetActiveUsers code (auto generated):
public virtual ObjectResult<tuser> GetActiveUsers()
{
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<tuser>("GetActiveUsers");
}