From dd7bf8a2c9f270bd67ec40821eefe850335aec04 Mon Sep 17 00:00:00 2001 From: Daniel Cohen Gindi Date: Mon, 25 Jun 2018 17:03:55 +0300 Subject: [PATCH] Use TryParse with Guid, fallback to String --- dg.Sql/Sql/Query/Query.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dg.Sql/Sql/Query/Query.cs b/dg.Sql/Sql/Query/Query.cs index 238ea0c5..eaba2416 100644 --- a/dg.Sql/Sql/Query/Query.cs +++ b/dg.Sql/Sql/Query/Query.cs @@ -386,8 +386,11 @@ public static void PrepareColumnValue(TableSchema.Column columnDefinition, objec } else if (columnDefinition.Type == typeof(Guid)) { - Guid gValue = new Guid((string)value); - value = gValue; + Guid gValue; + if (Guid.TryParse((string)value, out gValue)) + { + value = gValue; + } } } else