I am trying to figure out how i can add an object to a arraylist and afterwards returning it.
My code is following:
mediaTitleCollection = new ArrayList();
public BookMedia CreateBookTitle(string title, string subtitle, string edition, string author, string genre, int weight, int units, string isbn, int pages, int chapters)
{
mediaTitleCollection.Add(new BookMedia(title, subtitle, edition, author, genre, weight, units, isbn, pages, chapters));
// Return the object i have just added in mediaTitleCollection
}
I have tried a few methods and searched for half an hour, cant seem to find a proper solution to my question..
Thanks in advance.
1 Answer