Dapper Contrib - InsertAsync typeof not correct
andreatosato opened this issue · 0 comments
andreatosato commented
Hi all,
In my Azure Function custom output binding I have problem with Insert method.
My T entity is an interface, but at runtime I have concrete type.
I change this line of code in my scenario:
https://github.com/StackExchange/Dapper/blob/d19d6012e75feebf24d591ad21b16f13becc95f2/Dapper.Contrib/SqlMapperExtensions.Async.cs#L142
This is my resolution:
var type = entityToInsert.GetType();
Do you think that this is correct fix in all scenario?
Thanks a lot
P.S. my sample is here:
https://github.com/andreatosato/GAB2019/blob/c7ad8e222aa195685155135c7898319b4a936e14/AzureFunctionDeepDive/DeepDive.Extension.SQLBinding/Output/SqlOutputConfigurationProvider.cs#L20