Commit a8043e02 authored by Marc Gravell's avatar Marc Gravell

only attempt to set UdtTypeName after checking parameter type

parent e26ee0ab
......@@ -2941,7 +2941,10 @@ class GeographyMapper : Dapper.SqlMapper.TypeHandler<DbGeography>
public override void SetValue(IDbDataParameter parameter, DbGeography value)
{
parameter.Value = value == null ? (object)DBNull.Value : (object)SqlGeography.Parse(value.AsText());
((SqlParameter)parameter).UdtTypeName = "GEOGRAPHY";
if(parameter is SqlParameter)
{
((SqlParameter)parameter).UdtTypeName = "GEOGRAPHY";
}
}
public override DbGeography Parse(object value)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment