Martin Doms
Martin Doms

Reputation: 8748

How can I prevent a field from being copied to the client proxy in WCF RIA?

Is there a metadata attribute I can use to prevent a field from being accessible on the client in a WCF RIA services? I sure I have seen this before, but I'm drawing a blank and Google isn't helping. It would look something like

[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; }
    }
}

Upvotes: 1

Views: 264

Answers (2)

Dennis Traub
Dennis Traub

Reputation: 51654

Use the [Exclude]-Attribute

Upvotes: 2

Kyle McClellan
Kyle McClellan

Reputation: 2029

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

Upvotes: 2

Related Questions