From 403e6f3488a3e4fc8560e15ba5ba38c76b73b5ac Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Mon, 9 Sep 2019 11:37:08 -0700 Subject: [PATCH] Update SqlParameter example Direct users to take advantage of dotnet/corefx#35470 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d148bf4..ec44c31 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,10 @@ Write parameters like this. var geometry = new Point(-122.129797, 47.640049) { SRID = 4326 }; var geometryWriter = new SqlServerBytesWriter { IsGeography = true }; var bytes = geometryWriter.Write(geometry); -command.Parameters.AddWithValue(parameterName, new SqlBytes(bytes)); +var parameter = command.Parameters + .AddWithValue(parameterName, new SqlBytes(bytes)); + +// TODO: Set these if you're using Microsoft.Data.SqlClient +//parameter.SqlDbType = SqlDbType.Udt; +//parameter.UdtTypeName = "geography"; ```