MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

WCF

WCF Examples

WCF

WCF Projects

WCF Project

Data Contract Generics
Previous Home Next

Generics are specific to .NET, and using them would avoid the service-oriented nature of WCF and use bounded generic types in your data contracts, as long as you specify the type parameters in the service contract and as long as the specified type parameters have valid data contracts.We cannot define WCF contracts that rely on generic type parameters.

Using bounded generic types Example

[DataContract]
class MyClass<T>
{
[DataMember]
public T m_MyMember;
}
[ServiceContract]
interface IMyContract
{
[OperationContract]
void MyMethod(MyClass<int> obj);
}

 

Collections

A collection is any type that supports the IEnumerable or IEnumerable<T> interfaces. All of the built-in collections in .NET, such as the array, the list, and the stack support these interfaces.

A data contract can include a collection as a data member, or a service contract can define operations that interact with a collection directly. Because .NET collections are .NET-specific, WCF cannot expose them in the service metadata, yet because they are so useful, WCF offers dedicated marshaling rules for collections.

Example:

ServiceContract]
interface IContactManager
{
   [OperationContract]
   IEnumerable<Contact> GetContacts( );
   ...
}
class ContactManager : IContactManager
{
   List<Contact> m_Contacts = new List<Contact>( );
   public IEnumerable<Contact> GetContacts( )
   {
      return m_Contacts;
   }
   ...
}
Previous Home Next