C# nullable string error

前端 未结 6 1955
梦如初夏
梦如初夏 2020-11-27 05:19
private string? typeOfContract
{
  get { return (string?)ViewState[\"typeOfContract\"]; }
  set { ViewState[\"typeOfContract\"] = value; }
}

Later

6条回答
  •  青春惊慌失措
    2020-11-27 05:45

    For nullable, use ? with all of the C# primitives, except for string.

    The following page gives a list of the C# primitives: http://msdn.microsoft.com/en-us/library/aa711900(v=vs.71).aspx

提交回复
热议问题