We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类:RedisClient,方法:public T Get(string key); 调用:.Get<string[]>("fdfawerere"); 只有数组有这个问题,其他list,或string或实体都是正常的返回NULL,就数组返回了一个长度为0的数组,而不是NULL。
The text was updated successfully, but these errors were encountered:
public TValue ThrowOrValue<TValue>(Func<object, TValue> value) { if (IsError) throw new RedisServerException(this.SimpleError); var newval = value(this.Value); if (newval == null && typeof(TValue).IsArray) newval = (TValue)typeof(TValue).CreateInstanceGetDefaultValue(); this.Value = newval; return newval; }
if (newval == null && typeof(TValue).IsArray)
Sorry, something went wrong.
好,自己加了一个判断:
if (typeof(T).IsArray) { if(result == null || (result as Array).Length == 0) { return default(T); } }
No branches or pull requests
类:RedisClient,方法:public T Get(string key);
调用:.Get<string[]>("fdfawerere");
只有数组有这个问题,其他list,或string或实体都是正常的返回NULL,就数组返回了一个长度为0的数组,而不是NULL。
The text was updated successfully, but these errors were encountered: