From 107bbc07ef949fa2b108e6c4532e3f3f5cdb1404 Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Thu, 26 Jul 2018 10:09:16 -0500 Subject: [PATCH 1/2] Relax getters and setters in SnowflakeDbParameter.cs so that EntityFramework doesn't throw exceptions when logging and trying to assign defaults to parameter properties. --- Snowflake.Data/Client/SnowflakeDbParameter.cs | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Snowflake.Data/Client/SnowflakeDbParameter.cs b/Snowflake.Data/Client/SnowflakeDbParameter.cs index f313d7038..e8c1763be 100755 --- a/Snowflake.Data/Client/SnowflakeDbParameter.cs +++ b/Snowflake.Data/Client/SnowflakeDbParameter.cs @@ -54,14 +54,14 @@ public override ParameterDirection Direction public override bool IsNullable { - get - { - throw new NotImplementedException(); - } + get { return false; } set { - throw new NotImplementedException(); + if (value != false) + { + throw new SnowflakeDbException(SFError.UNSUPPORTED_FEATURE); + } } } @@ -73,40 +73,40 @@ public override string ParameterName public override int Size { - get - { - throw new NotImplementedException(); - } + get { return 0; } set { - throw new NotImplementedException(); + if (value != 0) + { + throw new SnowflakeDbException(SFError.UNSUPPORTED_FEATURE); + } } } public override string SourceColumn { - get - { - throw new NotImplementedException(); - } + get { return null; } set { - throw new NotImplementedException(); + if (value != null) + { + throw new SnowflakeDbException(SFError.UNSUPPORTED_FEATURE); + } } } public override bool SourceColumnNullMapping { - get - { - throw new NotImplementedException(); - } + get { return false; } set { - throw new NotImplementedException(); + if (value != false) + { + throw new SnowflakeDbException(SFError.UNSUPPORTED_FEATURE); + } } } From d52cfdb7a2188df1f97631e9b406b6e1f26ceb25 Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Mon, 20 Aug 2018 14:25:43 -0500 Subject: [PATCH 2/2] disable a resharper warning --- Snowflake.Data/Client/SnowflakeDbParameter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Snowflake.Data/Client/SnowflakeDbParameter.cs b/Snowflake.Data/Client/SnowflakeDbParameter.cs index e8c1763be..51a03a8b3 100755 --- a/Snowflake.Data/Client/SnowflakeDbParameter.cs +++ b/Snowflake.Data/Client/SnowflakeDbParameter.cs @@ -103,6 +103,7 @@ public override bool SourceColumnNullMapping set { + // ReSharper disable once RedundantBoolCompare (compare to false for clarity) if (value != false) { throw new SnowflakeDbException(SFError.UNSUPPORTED_FEATURE);