IgnoreAttribute 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 a method on a DomainService is not a domain operation.
Namespace: System.ServiceModel.DomainServices.Server
Assembly: System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)
The IgnoreAttribute type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Equals | (Inherited from Attribute.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Attribute.) |
![]() | GetType | (Inherited from Object.) |
![]() | IsDefaultAttribute | (Inherited from Attribute.) |
![]() | Match | (Inherited from Attribute.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
The following example shows a method in a domain service that is called by a domain operation, but is not exposed as a domain operation.
public void InsertCustomer(Customer customer) { if (customer.SalesPerson == String.Empty) { customer.SalesPerson = RetrieveSalesPersonForCompany(customer.CompanyName); } if ((customer.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(customer, EntityState.Added); } else { this.ObjectContext.Customers.AddObject(customer); } } [Ignore] public string RetrieveSalesPersonForCompany(string companyname) { string salesPersonToAssign = "unassigned"; List<Customer> customers = GetCustomers().Where(c => c.CompanyName == companyname).ToList(); if (customers.Count > 0) { salesPersonToAssign = customers.First().SalesPerson; } return salesPersonToAssign; }
Show:
