R
rodchar
Hi All,
I have a simple console app listed in its entirety below. I was just
wondering why I can't copy a list from point A to point B?
namespace PracticeCopyListToObject
{
class Program
{
static void Main(string[] args)
{
ReceiptList list2 = new ReceiptList();
List<Receipt> list = new List<Receipt>();
list.Add(new Receipt { InvoiceDate = "10/29/2009", ReceiptId = 2
});
list.Add(new Receipt { InvoiceDate = "10/28/2009", ReceiptId = 1
});
list2 = list; //how would i copy to my object
}
}
public class Receipt
{
public int ReceiptId { get; set; }
public string InvoiceDate { get; set; }
}
public class ReceiptList : List<Receipt>
{
public ReceiptList()
{
}
}
}
thanks,
rodchar
I have a simple console app listed in its entirety below. I was just
wondering why I can't copy a list from point A to point B?
namespace PracticeCopyListToObject
{
class Program
{
static void Main(string[] args)
{
ReceiptList list2 = new ReceiptList();
List<Receipt> list = new List<Receipt>();
list.Add(new Receipt { InvoiceDate = "10/29/2009", ReceiptId = 2
});
list.Add(new Receipt { InvoiceDate = "10/28/2009", ReceiptId = 1
});
list2 = list; //how would i copy to my object
}
}
public class Receipt
{
public int ReceiptId { get; set; }
public string InvoiceDate { get; set; }
}
public class ReceiptList : List<Receipt>
{
public ReceiptList()
{
}
}
}
thanks,
rodchar