I have a method
public List<string> getMList()
{
List<string> listM=null;
listContracts.ForEach(delegate(Cobj contract)
{
listM.Add(contract.M);
});
return (listM);
}
The problem is I need to get just the first item in the list. Say,
string mm=getMList[0]; // does not work
What is the best way to get the first object in a list ?
thanks.
public List<string> getMList()
{
List<string> listM=null;
listContracts.ForEach(delegate(Cobj contract)
{
listM.Add(contract.M);
});
return (listM);
}
The problem is I need to get just the first item in the list. Say,
string mm=getMList[0]; // does not work
What is the best way to get the first object in a list ?
thanks.