Top "Nullable" questions

The nullable tag is for issues relating to nullable members or types.

Should I use a Guid and Guid.Empty or a nullable Guid?

I have certain scenarios (e.g. a custom class to hold Sql parameters) in which a variable may or may …

c# nullable language-features is-empty
Checking if Type instance is a nullable enum in C#

How do i check if a Type is a nullable enum in C# something like Type t = GetMyType(); bool isEnum = …

c# enums nullable
How to allow null value in required nullable DateTime in .NET MVC3 HTML form?

I have tried: [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}", ConvertEmptyStringToNull = true)] [Required(AllowEmptyStrings = true)] public DateTime? BirthDateFrom { get; set; } …

asp.net-mvc datetime nullable required
Cast a null into something?

I had this interesting discussion today with a colleague. We were debating two pieces of code in C#. Code Snippet 1: …

c# .net casting nullable dbnull
Nullable values in C++

I'm creating a database access layer in native C++, and I'm looking at ways to support NULL values. Here is …

c++ data-access-layer nullable
Hibernate default joining for nullable many-to-one

I have a hibernate mapping like this in a ProductDfn class @ManyToOne( fetch = FetchType.LAZY, optional = true ) @JoinColumn( name = "productTypeFk", …

hibernate join nullable outer-join
Set property Nullable<> by reflection

I try to set a Nullable<> property dynamicly. I Get my property ex : PropertyInfo property = class.GetProperty("PropertyName"); // …

c# generics reflection nullable activator
C# how to check for null. (value is null) or (null == value). Can we use `is` operator instead of == operator

C# how to check for null. (value is null) or (null == value). Can we use is operator instead of == operator? …

c# null nullable c#-7.0
Not annotated parameter overrides @??? parameter

While overriding code: @Override public void open(ExecutionContext executionContext) { super.open(executionContext); from: org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader I …

spring intellij-idea warnings nullable notnull
default(Nullable(type)) vs default(type)

In C#, is there a difference between default(Nullable<long>) (or default(long?)) and default(long) ? Long is …

c# default nullable