I have the following field definition in a class:
public Nullable<System.Guid> GlobalId { get; set; }
I have another class with the following:
public string GlobalId { get; set; }
I would like to put the value of from the field with type System.Guid into the string.
I tried to do this here:
var questionIds = _questionsRepository.GetAll()
.Where(m => m.Problem != null &&
m.Problem.SubTopic != null &&
m.Problem.SubTopic.Topic != null &&
m.Problem.SubTopic.Topic.SubjectId == 1)
.Select(m => new QuestionHeader { GlobalId = (string) m.GlobalId })
.ToList();
return questionIds;
But it's giving me an error saying:
Cannot convert type 'System.Guid?' to 'string'
Can someone tell me how I could do this?