ExcludeAttribute Class

WCF RIA Services

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Specifies that an entity member will not exist in the code-generated client view of the entity, and that the value should never be sent to the client.


Namespace:  System.ServiceModel.DomainServices.Server
Assembly:  System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)

[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false, 
	Inherited = true)]
public sealed class ExcludeAttribute : Attribute

The ExcludeAttribute type exposes the following members.

Public methodExcludeAttributeInitializes a new instance of the ExcludeAttribute class.

Public propertyTypeId (Inherited from Attribute.)

Public methodEquals (Inherited from Attribute.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodMatch (Inherited from Attribute.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)

Explicit interface implemetationPrivate method_Attribute.GetIDsOfNames (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfo (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfoCount (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.Invoke (Inherited from Attribute.)

You apply the ExcludeAttribute attribute to a property when you do not want to make the property available to client applications. Many values, such as identity values, are managed in the data source and do not need to be displayed or edited in the client.

The following example shows the ExcludeAttribute applied to property named rowguid which is of Guid type.

public partial class Address

    internal sealed class AddressMetadata
        // Metadata classes are not meant to be instantiated.
        private AddressMetadata()

        public int AddressID;

        public string AddressLine1;

        public string AddressLine2;

        public string City;

        public string CountryRegion;

        public EntityCollection<CustomerAddress> CustomerAddresses;

        public DateTime ModifiedDate;

        public string PostalCode;

        public Guid rowguid;

        public string StateProvince;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.