EnumAsInt with .Equals

With an [EnumAsInt] named SystemState…

This query works…

  var location = sqlXrm.Single<Location>(l => l.StateCode == SystemState.Active);

… but this errors with “Conversion failed when converting the varchar value ‘Active’ to data type int”…

  var location = sqlXrm.Single<Location>(l => l.StateCode.Equals(SystemState.Active));

It’s not a big deal but I’m keep falling foul of it because I’m used to the .Equals syntax. Any way I can get the latter to work?


Pete

This should now be resolved with this commit.

This change is available from v5.4.1 that’s now available on MyGet.

Wow brilliant. Thanks a lot!