This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello,
Any reason this should throw an exception!?
using(var uow = context.CreateUnitOfWork()) throws an exception. When changing it to a simpler query it works : at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) |
|
|
This appears to be a bug, but there is an easy workaround: explicitly compare the boolean to true, e.g. var query = from emp in unitOfWork.Employees Thanks for reporting this! I will log it and get it fixed. |
|
|
Hi, It seems that proposed workaround works well. But as I see, the SQL Date functions are not supported too. You could try the above query like : |
|
|
Translating the Date function into SQL may depend on the database provider. Let me know which database you're using and I'll look into it. Thanks! |
|
|
Actually I'm using SQL Server 2005 and SQLite for tests. Is is possible to plug-in our own database provider, extending one of providers you already have? |
|
|
Bad news I'm afraid: we don't support translation of the Date property onto either of those databases. (In the case of SQL Server, this is because there isn't a built-in DATE() function, and we don't currently have the ability to generate the necessary complex queries to work around this. In the case of SQLite, it is because the built-in DATE() function does not support comparison to date-time types.) I have logged a feature request for this because the work required to support Date on these databases would also allow us to implement some other stuff we'd like to have but is held up by the same issues (e.g. time accessors such as .Minute). In the meantime, one possible (though admittedly ugly) workaround is to make explicit year, month and day comparisons, e.g. where emp.EmploymentDate.Year == DateTime.Now.Year && emp.EmploymentDate.Month == DateTime.Now.Month && emp.EmploymentDate.Day == DateTime.Now.Day However, I should warn you that this will not work in your current test environment because we do not support *any* time and date functions on SQLite at the moment. (And just as a heads up, we don't currently support time functions on SQL Server -- only date functions i.e. Year, Month and Day.) Sorry! Regarding database providers, we do not currently have a way for customers to plug in their own database providers, but if you have a specific database in mind that you would like us to support, let us know and we will certainly consider it. |
|