Translator for DataContractCollection

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
Jun 19, 2008 at 3:07 PM

Hi,

I am trying to generate a translater for converting DataContractCollection to a business entity

Referring to hands on lab, here are the data contracts generated

+DataContract Collection : +

public partial class Contacts : System.Collections.ObjectModel.Collection<Contact>
 {
 }

+DataContract: +

public partial class Contact
 {
  private string name;
  private string phoneNumber;
  private PhoneNumberType phoneNumberType;
  
  [WcfSerialization::DataMember(Name = "Name", IsRequired = false, Order = 0)]
  public string Name
  {
    get { return name; }
    set { name = value; }
  }    
  ---
   ---
  ---

}

My business entity will be Contact[ note it is not a collection]

Method in Business layer will return List<BusinessEntities.Contact>

Need help on generating Transalator to convert output from Businesslogic layer back to DataContractCollection.[ i.e List<BusinessEntities.Contact> to Contacts ]