Hi, I wanted to call the InsertWithOutputIntoAsync method with the following request:
await source.InsertWithOutputIntoAsync(
targetTable,
valueFromTargetTable=> valueFromTargetTable,
otherTable,
valueFromTargetTable=> new OtherClass
{
Id = valueFromTargetTable.Id,
Status = 1
});
But I caught an exception when calling such code:
System.InvalidCastException : Unable to cast object of type 'LinqToDB.Linq.Table`1[OtherTable]' to type 'System.Linq.IQueryable`1[TargetTable]'
When I started looking at the source code, what I saw was that the method has this code (IQueryable<TTarget>)outputTable
link to the source:
https://github.com/linq2db/linq2db/blob/master/Source/LinqToDB/LinqExtensions.Insert.cs/#L300
Why do you need a type conversion? The semantics of the method allows you to call the code that I have.
Hi, I wanted to call the InsertWithOutputIntoAsync method with the following request:
But I caught an exception when calling such code:
When I started looking at the source code, what I saw was that the method has this code
(IQueryable<TTarget>)outputTablelink to the source:
https://github.com/linq2db/linq2db/blob/master/Source/LinqToDB/LinqExtensions.Insert.cs/#L300
Why do you need a type conversion? The semantics of the method allows you to call the code that I have.