0
誰能幫我把這段代碼轉換在.NET的核心:等效System.Data.Linq.Binary
private static string GetValueFromModelValue(object formValue)
{
//Test to determine if its binary data. If it is, we need to convert it to a base64 string.
Binary binaryValue = formValue as Binary;
if (binaryValue != null)
{
formValue = binaryValue.ToArray();
}
//If the above conversion to an array worked, then the following will cast as a byte array and convert.
byte[] byteArrayValue = formValue as byte[];
if (byteArrayValue != null)
{
formValue = Convert.ToBase64String(byteArrayValue);
}
return formValue.ToString();
}