Open kiquenet opened 4 years ago
Can we back up slightly to what you're trying to do? Generally speaking if you need to reflect Dapper and it's a valid use case, we have a gap in the API which we could potentially solve in other ways!
What are you trying to read or change?
I think this should work, but haven't tested it.
var typeTableName = typeof(SqlMapperExtensions)
.GetFields(BindingFlags.Static | BindingFlags.NonPublic)
.FirstOrDefault(field => field.Name == "TypeTableName")
.GetValue(null);
How access to TypeTableName in Dapper.Contrib.Extensions.SqlMapperExtensions class using Reflection?
private static readonly ConcurrentDictionary<RuntimeTypeHandle, string> TypeTableName = new ConcurrentDictionary<RuntimeTypeHandle, string>();
Not cannot set null to SqlMapperExtensions.TableNameMapper because use TypeTableName
https://github.com/StackExchange/Dapper/blob/main/Dapper.Contrib/SqlMapperExtensions.cs#L280