WCF Examples


WCF Projects

WCF Project

DataTableHelper.ToArray( )
Previous Home Next

DataTableHelper.ToArray ( )

DataTableHelper used for add some type safety . at compile time, DataTableHelper places constraints on the type parameter R to be a data row and at runtime, the method returns an empty array if the table is empty.

DataTableHelper.ToArray( ) use the myCollection helper class to invoke the converter on every row in the table, converting every row to a single Contact and returning the resulted array and It verifies that the type parameter T is decorated either with the DataContract attribute or the Serializable attribute.


Instance Management:

Instance managementis the name for a set of techniques used by WCF to bind client requests to service instances, governing which service instance handles which client request.


Behavior is a local attribute of a service that does not affect its communication patterns. Clients should be unaware of behaviors, and behaviors do not manifest themselves in the service's binding or published metadata.

Type of Behaviors:

Two type of behaviors

  1. ServiceBehaviorAttribute
  2. OperationBehaviorAttribute
  1. ServiceBehaviorAttribute

    The ServiceBehavior attribute is used to configure the service instance mode.

    Example of The ServiceBehaviorAttribute used to configure instance context mode

    public enum InstanceContextMode
    public sealed class ServiceBehaviorAttribute : Attribute,...
       public InstanceContextMode InstanceContextMode
       //More members
  2. OperationBehaviorAttribute

    The OperationBehaviorAttribute is used to configure operation behaviors, and it can be applied only on a method that implements a contract operation, never on the operation definition in the contract itself.

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Comment / Feedback: