public HttpResponseMessage PostTrainingSchedule(TrainingSchedule schedule)
        {
            HttpResponseMessage response;
            if (ModelState.IsValid)
            {
                try
                {
                    trainingScheduleRepository.Insert(schedule);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
                finally
                {
                    response = Request.CreateResponse(HttpStatusCode.Created, schedule);

                }
            }
            else
            {
                response= Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
            return response;
        }
 public HttpResponseMessage PutTrainingSchedule(int id, TrainingSchedule schedule)
 {
     try
     {
         Logger.Info("Updating TrainingSchedule");
         if (id != schedule.Id)
         {
             return Request.CreateResponse(HttpStatusCode.BadRequest);
         }
         var sch = schedule;
         sch.ExamDate= sch.ExamDate.ToLocalTime();
         sch.IntakeDate = sch.IntakeDate.ToLocalTime();
         trainingScheduleRepository.Update(x=>x.Id==sch.Id,sch);
         Logger.Info("Updated");
         return Request.CreateResponse(HttpStatusCode.OK);
     }
     catch (Exception ex)
     {
         Logger.Error(ex.Message,ex);
         return Request.CreateResponse(HttpStatusCode.Conflict);
     }
 }