private void AddAppointment(string subject, string location, DateTime startTime, DateTime endTime, string body) { using (var api = new BusinessContext()) { var appointment = new Appointment { Subject = subject, Location = location, StartTime = startTime, EndTime = endTime, Body = body } ; try { api.AddNewAppointment(appointment); } catch (Exception) { Console.WriteLine("Api arror by appointments"); } this.appointments.Add(appointment); } }