-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvalidCastException when table merging #1209
Comments
@ichemidov, will handle this. Thanks for reporting. |
BTW, it is syntetic sample? I do not see purpose why you have used temporary table. Grouping query can be used in merge operation without objects materialzation. |
In some ways it's syntetic sample. I've create it to understand how works merge api. But In the future I plan to extend it (add fields to classes in sample) and use in my project. |
@ichemidov, unfortunately i can not reproduce issue. |
I ask because such exception is possible if somewhere in dynamic Expression Tree generation used incorrect Join method call. I have reviewed our code according to call stack and not found problems. |
@sdanyliv, I created sample project and I was even able to localize the problem. No Exception
InvalidCastException
|
@ichemidov, again. public static IQueryable<TResult> Join<TOuter, TInner, TResult>(
[NotNull] this IQueryable<TOuter> outer,
[NotNull] IQueryable<TInner> inner,
[SqlQueryDependent] SqlJoinType joinType,
[NotNull, InstantHandle] Expression<Func<TOuter, TInner, bool>> predicate,
[NotNull, InstantHandle] Expression<Func<TOuter, TInner, TResult>> resultSelector)
P.S. |
@sdanyliv, do you run the project "as is"? Lines 47-58 in WsDataProvider.cs are commented? P.S. |
Really strange. Could you please clone linq2db sources and add refrence to the library in your test project? |
So, I cloned linq2db sources and build it (I had to change file |
Just add reference to the linq2db.csproj. And try figure our why it fails. |
Fixed in bb1ef44 |
I'm trying update table Registry with List of my own class objects. I found that I should use temp tables for merge with my collection and then merge this temp table with target table.
But when I use Merge operation I'm getting InvalidCastException.
Steps to reproduce
Environment details
linq2db version: 2.1.0
Database Server: SqlServer 2016 (13.0.4001.0)
Operating system: Windows 8
Framework version: .NET Framework 4.5.2
The text was updated successfully, but these errors were encountered: