纯粹的字符串.IsNullOrWhiteSpace() [英] Pure on string.IsNullOrWhiteSpace()

查看:75
本文介绍了纯粹的字符串.IsNullOrWhiteSpace()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用  Silverlight项目我得到一个警告:方法string.IsNullOrWhiteSpace()在合同中使用时不是纯粹的,但如果我将其更改为string.IsNullOrEmpty ()方法警告消失。

With Silverlight project I get a warning that method string.IsNullOrWhiteSpace() is not pure if used in contracts but if I change it to string.IsNullOrEmpty() method the warning disappears.

但是如果我在.NET 4.0项目中使用string.IsNullOrWhiteSpace()则没有警告。

However if I use string.IsNullOrWhiteSpace() in a .NET 4.0 project there is no warning.

是有可能string.IsNullOrWhiteSpace()在Silverlight中没有使用Pure属性进行修饰,但它在.NET框架中?

Is it possible that string.IsNullOrWhiteSpace() is not decorated with Pure attribute in Silverlight but it is in .NET framework?

谢谢,Martin

推荐答案

嗨Martin,

Hi Martin,

我遇到了同样的问题。

我检查了Silverlight 4.0合约程序集,实际上 IsNullOrWhiteSpace 标记为
Pure ,所以我不确定导致此警告的原因。

I checked the Silverlight 4.0 contract assembly and in fact IsNullOrWhiteSpace is marked Pure, so I'm not sure what is causing this warning.

警告1在方法'Bar.Foo(System.Reflection。)的合同中检测到方法'System.String.IsNullOrWhiteSpace(System.String)'没有[Pure]的调用。的MemberInfo,System.Fu nc`2< type parameter.TAttribute,System.String>,System.String @)'

- Dave


这篇关于纯粹的字符串.IsNullOrWhiteSpace()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆