Accessing the value contained within a record struct
I have a
I understand this is an immutable object, in that once its been created it can't be modified... but how do I get access to the Id of this DTO for use in my code?
obviously the last line doesn't work but I'm not trying to modify the record struct, I just want access to the data.
I'm passing the
I guess alternatively I could modify the AssessmentRequest to have an Id property contained within it and allow it to be nullable? but there's got to be a way to access the Id within the
record struct of AssessmentResponse:I understand this is an immutable object, in that once its been created it can't be modified... but how do I get access to the Id of this DTO for use in my code?
obviously the last line doesn't work but I'm not trying to modify the record struct, I just want access to the data.
I'm passing the
AssessmentResponse? if it exists to the Blazor component, and want to access the Id section for the API call to update the record in my database. My AssessmentService.Update call requires an Guid, AssessmentRequestI guess alternatively I could modify the AssessmentRequest to have an Id property contained within it and allow it to be nullable? but there's got to be a way to access the Id within the
record struct and assign its value to another variable for use elsewhere.