Although is also quite ugly, you can use DbContext.Database.SqlQuery
to run the query directly in the database. The good news is that the result of running this query will be mapped to the entity type in your db context. I.e. you will not get an anonymous type collection, but a collection of the class that you have mapped to tblTransactions
, provided you've defined that mapping.
There is no way to: use a CLR (C#) function that translates as a conversion from string to date, or to number, or a function or operator for comparing strings which is trasnlated to SQL or invoke a SQL UDF defined for this.
I've also pointed out in a comment that, if you're allowed to create views you can map to a view which has columns converted from string to datetime (or to number). Or use computed columns. You'd have to adapt your entity to support the extra columns.
This is a comprehensive list of functions that can be translated from CLR to SQL:
Surprisingly, none of them offers a direct solution to your problem.