Comments on: Filtering on a tinyint with Entity Framework https://blog.hompus.nl/2013/01/21/filtering-on-a-tinyint-with-entity-framework/ Because I like to share knowledge Tue, 19 Dec 2017 07:25:00 +0000 hourly 1 https://wordpress.org/?v=5.2.2 By: Generated query for tinyint column introduces a CAST to int - QuestionFocus https://blog.hompus.nl/2013/01/21/filtering-on-a-tinyint-with-entity-framework/#comment-932 Tue, 19 Dec 2017 07:25:00 +0000 http://blog.hompus.nl/?p=257#comment-932 […] I ran into the same problem and blogged about it. […]

]]>
By: Filip Sielimowicz https://blog.hompus.nl/2013/01/21/filtering-on-a-tinyint-with-entity-framework/#comment-122 Fri, 24 Oct 2014 13:13:16 +0000 http://blog.hompus.nl/?p=257#comment-122 Instead of using contains/equals and rewriting queries, consider using FixIntCast extension on querablies, as shown here:
http://stackoverflow.com/questions/9016265/generated-query-for-tinyint-column-introduces-a-cast-to-int

]]>
By: Melih https://blog.hompus.nl/2013/01/21/filtering-on-a-tinyint-with-entity-framework/#comment-121 Wed, 18 Sep 2013 17:10:18 +0000 http://blog.hompus.nl/?p=257#comment-121 Nice article but 1 question. What if we have to compare values ? for example i have a tinyint column and i want to query table by myValue is greater that this column..

Your solution is just for "Equal", what if "Greater than" or "Less than" ?

]]>
By: Michaël Hompus https://blog.hompus.nl/2013/01/21/filtering-on-a-tinyint-with-entity-framework/#comment-120 Wed, 27 Feb 2013 20:48:00 +0000 http://blog.hompus.nl/?p=257#comment-120 Hi Rich,
That's strange, it shouldn't cast anything, which version of SQL. .NET and EF are you using?

]]>
By: Rich F https://blog.hompus.nl/2013/01/21/filtering-on-a-tinyint-with-entity-framework/#comment-119 Wed, 27 Feb 2013 13:19:27 +0000 http://blog.hompus.nl/?p=257#comment-119 Thanks Michaël, this is the only workaround I found for this issue and it seems to work fine for me. The only thing I did find was that the revised query now casts the value which your example doesn't do?

]]>