cannot convert from 'System.Guid?' to 'System.Guid'

前端 未结 4 1542
隐瞒了意图╮
隐瞒了意图╮ 2021-01-03 22:01

Does anyone know how to deal with this error?

cannot convert from \'System.Guid?\' to \'System.Guid\'
4条回答
  •  心在旅途
    2021-01-03 22:52

    Use Guid?.Value property to convert 'System.Guid?' to 'System.Guid'. as following example

     Obj GetValue(Guid yourID)
    {
    return FetchObject(yourID)
    }
    Void main()
    {
    Guid? passvalue;
    Obj test = GetValue(passvalue.Value);
    }
    

提交回复
热议问题