1
Answer

collections generic with wcf

Ask a question
yoni m

yoni m

11y
1.3k
1
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)