-
Notifications
You must be signed in to change notification settings - Fork 18
NULL values
sdrapkin edited this page Feb 13, 2017
·
4 revisions
NULL T-SQL values are automatically converted into null .NET reference values and Nullable<T> struct values.
NULL parameter values can be specified by explicitly typing anonymous-object properties as type-null or Nullable<T>:
var result = await db.QueryAsync("UPDATE [SomeTable] SET [IntValue] = @Val WHERE [Id] = @Id",
new
{
@Id = new Guid("cf9fad7a-9775-28b9-7693-11e6ea3b1484"),
@Val = default(int) // setting [IntValue] to NULL
});Copyright (c) 2016-2022 Stan Drapkin