Q: Displaying all items in another class My problem is that I have a List<> variable connected to another class, and I want to get all the items from that List<> and put it into a string.
In the result string, i'd like to see callNum, copyNum, content, author, year, title
Here is where I'm trying to put it into a string
public class CItemControl
    {
        //declare a list variable
        private List<CItem> mItems;
        private CItem mNewItem;
        //a method that instantiates the list
        public CItemControl()
        {
            mItems = new List<CItem>();
        }
        //attribute to get all items
        public List<CItem> Items
        {
            get { return mItems; }
        }
        public CItem NewItem
        {
            get { return mNewItem; }
        }
        //method to add item to the CItem list
        public void AddItem(int callNum, int copyNum, string content, string author, string year)
        {
            mNewItem = new CItem(callNum, copyNum, content, author, year);
            mItems.Add(mNewItem);
        }
        //method to return all items to a string
        public CItem ListAllItems()
        {
            string allItems;


        }

Here is the class where I'm trying to get the items from. There will be variables added later.
class CItem
    {
        //declare attributes
        private string mTitle;
        private string mAuthor;
        private string mContent;
        private string mYear;
        private int mCopyNum;
        private int mCallNum;
        private bool mHold = false;
        private bool mBorrowed = false;
        private bool mShelf = false;

        //overload a constructor
        public CItem(int CallNum, int CopyNum, string Content, string Author, string Year)
        {
            callNum = CallNum;
            copyNum = CopyNum;
            content = Content;
            author = Author;
            year = Year;
        }

        //create the default constructor
        public CItem()
        {
            callNum = 0;
            copyNum = 0;
            content = "";
            author = "";
            year = "";
        }

        //set attributes
        public int callNum
        {
            get { return mCallNum; }
            set { mCallNum = value; }
        }
        public string content
        {
            get { return mContent; }
            set { mContent = value; }
        }
        public string author
        {
            get { return mAuthor; }
            set { mAuthor = value; }
        }
        public string year
        {
            get { return mYear; }
            set { mYear = value; }
        }
        public string title
        {
            get { return mTitle; }
            set { mTitle = value; }
        }
        public int copyNum
        {
            get { return mCopyNum; }
            set { mCopyNum = value; }
        }
        public bool hold
        {
            get { return mHold; }
        }
        public bool borrowed
        {
            get { return mBorrowed; }
        }
        public bool shelf
        {
            get { return mShelf; }
        }

        //display information for users
        public string displayInfo()
        {
            return "Call Number: " + callNum + ". Copy Number: " + copyNum + ". Title: " + title +
                ". Author: " + author + ". Year Published: " + year + ". Content: " + content;
        }

        //new method to display status of item
        public string displayStatus()
        {
            if (borrowed == true)
                return "Item is currently being borrowed.";
            if (shelf == true && hold == false)
                return "Item is available for borrowing.";
            else
                return "Item is on hold";
        }

Any help is much appreciated!
Thanks in advance.

A: ListAllItems shall look something like this
public string ListAllItems()
{
    var sb = new StringBuilder();   // var is of type StringBuilder
    mItems.ForEach(item => sb.Append(item.displayInfo());
    return sb.ToString();
}


A: return String.Join("; ", allItems.Select(item => item.displayInfo()));


A: You don't provide a lot of informations on how and what informations you want in your result string.
Can't you achieve this objective with a simple loop ?
using System.Text; 
(...)
public string ListAllItems()
{
    StringBuilder allItems = new StringBuilder();

    foreach(CItem itm in Items){
        allItems.AppendLine(itm.displayInfo());
    } 

    return allItems.ToString();      
}

Stringbuilder is optional but is faster than string concatenation.

A: I don't normally like to add formatter methods to property bags like this.  If you want the flexibility to change have many formatting implementations, you might want to make a seperate class do the formatting.  
public interface IFormatter<in T>
{
    string Format(T obj);
}

public class CItemFormatter : IFormatter<CItem>
{
    public string Format(CItem item)
    {
        //formatting logic
    }
}

