Bug #77735 | OrderBy Case CaseFragment.Accept(SqlFragmentVisitor visitor)NullReferenceExcepti | ||
---|---|---|---|
Submitted: | 15 Jul 2015 17:14 | Modified: | 21 Aug 2015 6:11 |
Reporter: | fu xuejun | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.9.6 | OS: | Windows (.net 4.5) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[15 Jul 2015 17:14]
fu xuejun
[15 Jul 2015 17:16]
fu xuejun
I use EF5 with asp.net MVC5 and the framework version is 4.5.
[15 Jul 2015 17:22]
fu xuejun
I debug the source code with the connector, the I find {(`Extent1`.`Code` = @p__linq__0) AND ((CASE WHEN (NOT ((@p__linq__1 IS NULL) OR ((LENGTH(@p__linq__1)) = 0))) THEN (CASE WHEN (`Extent1`.`Status` = @p__linq__2) THEN (1) WHEN (`Extent1`.`Status` != @p__linq__2) THEN (0) END) ELSE (1) END) = 1)} I find there no else in case when then else statement. So I change My code like below: RoomRepository.Entities.Where( room => room.Code == code && (!String.IsNullOrEmpty(status) && room.STATUS == status ? true : false)) // ; .OrderBy(room => room.ROOM_NO); It works fine. But I want my old code works well, too. can you fix that? My English is so bad, sorry.
[16 Jul 2015 6:06]
Chiranjeevi Battula
Hello fu xuejun, Thank you for the bug report. Could you please provide repeatable test case (exact create table statements, model, context class, etc.) to confirm this issue at our end? Thanks, Chiranjeevi.
[16 Jul 2015 7:34]
fu xuejun
I also find, when the Status Field is null in database , it will not raise exception, but there is no data return.
[21 Jul 2015 6:11]
Chiranjeevi Battula
Hello fu xuejun, Thank you for your feedback. I could not repeat the issue using with EntityFramework 6.1.3. Could you please try with EF6.1.3 and let us know if you are still facing issue with repeatable steps. Thanks, Chiranjeevi.
[22 Aug 2015 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".