Guid mainfolderid = (main.GetValue(""));
where main is a dynamic entity.
How can I convert the above mentioned main.GetValue("") to System.Guid?
The error says
Cannot implicitly convert type object to ‘System.Guid’.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Does the
GetValuemethod actually return aGuidtyped asobject? If so, then you just need to perform an explicit cast like so:If not, does
GetValuereturn something that can be passed to one of the constructors (ie, abyte[]orstring)? In that case you could do this:If neither of the above are applicable then you’re going to need to do some manual work to convert whatever’s returned by
GetValueto aGuid.