예제 #1
0
 public void AddYear(Year yearToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Years.Add(yearToBeAdded);
         context.SaveChanges();
     }
 }
예제 #2
0
        public Year CreateYear()
        {
            Console.Write("Year Founded: ");
            string founded = Console.ReadLine();
            Console.Write("\nYear Disbanded: ");
            string disbanded = Console.ReadLine();
            if (disbanded == "")
            {
                disbanded = null;
            }

            Year newYear = new Year()
            {
                YearFounded = founded,
                YearDisbanded = disbanded
            };

            return newYear;
        }