using System;
using System.Linq;

namespace InABox.Core
{
    [Serializable]
    public class CoreColumn
    {
        public CoreColumn()
        {
            DataType = typeof(object);
        }
        public CoreColumn(string columnName) : this(typeof(object), columnName) { }

        public CoreColumn(Type dataType, string columnName)
        {
            DataType = dataType;
            ColumnName = columnName;
        }

        public Type DataType { get; set; }

        public string ColumnName { get; set; }

        public override string ToString()
        {
            return string.Format("{0} ({1})", ColumnName, DataType.EntityName().Split('.').Last());
        }

    }
}