I have a SQL Server database with a table that has a uniqueidentifier
column InputID
that allows null values.
In my C# project, I am passing the value of InputID
as object InputID
to my SqlDataAdapter
and there I am parsing the object as Guid
if it is not null.
sqlDataAdapter.UpdateCommand.Parameters.Add(new SqlParameter("@InputID", SqlDbType.UniqueIdentifier)).Value = InputID == null ? null : Guid.Parse(InputFromTestCaseID.ToString());
Unfortunately the
InputID == null ? null : Guid.Parse(InputFromTestCaseID.ToString());
throws an error
CS8370 Feature 'target-typed conditional expression' is not available in C# 7.3. Please use language version 9.0 or greater.
What am I doing wrong?