using System.Collections.Generic;
namespace CarErrorSample.Models
{
    public class CarType
    {
        public int Id { get; set; }
        public string Name { get; set; }

        private List<CarType> types;

        public CarType()
        {
            types = null;
        }

        public List<CarType> CarTypes
        {
            get
            {
                if (types == null)
                    types=DummyData();
                return types;
            }
        }

        private static List<CarType> DummyData()
        {

            List<CarType> dummyList = new List<CarType>();
            dummyList.Add(new CarType()
            {
                Id=0,
                Name="N/A"
            });
            dummyList.Add(new CarType()
            {
                Id = 1,
                Name = "Automatic"
            });
            dummyList.Add(new CarType()
            {
                Id = 2,
                Name = "Manual"
            });
            return dummyList;
        }
    }
}
