如何防止在WCF RIA中将字段复制到客户端代理?

时间:2011-03-02 22:07:51

标签: wcf-ria-services

我是否可以使用元数据属性来阻止在WCF RIA服务中在客户端上访问字段?我确定我之前已经看过这个,但我正在画一个空白而谷歌没有帮助。它看起来像

[MetadataType(typeof(User.UserMetadata))]
public partial class User
{
    internal sealed class UserMetadata
    {
        private UserMetadata()
        {
        }

        public int Id { get; set; }

        [HideFromClientProxy]
        public string PasswordSalt { get; set; }
    }
}

2 个答案:

答案 0 :(得分:2)

[Exclude]
public string PasswordSalt { get; set; }

答案 1 :(得分:2)

使用[Exclude] - 属性

相关问题