yoni m

yoni m

  • 1.7k
  • 5
  • 1.5k

collections generic with wcf

Jan 19 2013 7:26 PM
hi all 
 
I want to pass generic collection, List with wcf 
 
how to do that ? 
 
i tried [datamember] but it's don't work

this is my code 

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace BE
{
[DataContract]
public class BusinessAccount : Account
{
private string companyNumber;
private string companyName;
private List<string> authorizedSignatory = new List<string>();

public BusinessAccount() { }

public BusinessAccount(long number, int branchNumber, DateTime openingAccountDate, string password, int credit, int balance,
AccountStatus status, AccountType account_Type, string companyNumber, string companyName, List<string> authorizedSignatory)
: base(number,branchNumber,openingAccountDate,password,credit,balance,status,account_Type)
{
this.companyNumber = companyNumber;
this.companyName = companyName;
this.AuthorizedSignatory = authorizedSignatory;
}

[DataMember]
public string CompanyNumber
{
get { return companyNumber; }
set { companyNumber = value; }
}

[DataMember]
public string CompanyName
{
get { return companyName; }
set { companyName = value; }
}

[DataMember]
public List<string> AuthorizedSignatory
{
get { return authorizedSignatory; }
set
{
foreach (var item in value)
authorizedSignatory.Add(item);
}
}
}
}


Answers (1)