using System;
using System.Linq;
using System.Collections.Generic;

namespace CarErrorSample.Models
{
    public class Country
    {
        public int Id { get; set; }
        public string Name { get; set; }

        private List<Country> countries;

        public Country()
        {
            countries = null;
        }

        public List<Country> Countries
        {
            get
            {
                if (countries == null)
                    countries=DummyData();
                return countries;
            }
        }

        private static List<Country> DummyData()
        {

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