任何人都可以帮助我在.net core中转换此代码:
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();
}
答案 0 :(得分:0)
{1}中的类型在.NET Core和.NET Standard版本(目前为1.0 - 2.0)中不可用。
由于没有调用者可以传入.NET Core上的System.Data.Linq
对象,因此您可以删除代码或将其放在预处理器定义中(此示例假定为.NET Core 1.1构建):
Binary