-1

I am studying a code that uses guid data types using a ? , and sincerily I don't have idea about what means. ¿Can anybody helpme? Thanks in advance.

public Stream GetContent(Guid fileId, Guid? versionId = null)
{
     const string test = "Testing 1-2-3";

     // convert string to stream
     var byteArray = Encoding.ASCII.GetBytes(test);
     var stream = new MemoryStream(byteArray);
     return stream;
}   
MadDev
  • 113
  • 16
  • This means "Null" so the Field either would accept a value or a null . this is called nullable operator – Apoorv Jun 19 '17 at 09:48
  • Nullable types can represent all the values of an underlying type, and an additional null value. Nullable types are declared in one of two ways: System.Nullable variable -or- T? variable T is the underlying type of the nullable type. T can be any value type including struct; it cannot be a reference type. – Hardik Leuwa Jun 19 '17 at 11:27
  • https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/using-nullable-types – Hardik Leuwa Jun 19 '17 at 11:31

1 Answers1

-1

This means "Null" so the Field either would accept a value or a null . this is called nullable operator

Apoorv
  • 2,023
  • 1
  • 19
  • 42