Пример #1
0
 public MainObjective CreateMainObjective(CreateMainObjectiveVM mainObjective)
 => Map(mainObjective, x => new MainObjective
 {
     Order      = x.Order,
     Content    = x.Name,
     CourseCode = x.CourseCode
 });
Пример #2
0
 public IHttpActionResult CreateMainObjective(CreateMainObjectiveVM mainObjectiveVM)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     try
     {
         if (_mainObjectiveService.Create(ModelBuilder.CreateMainObjective(mainObjectiveVM)))
         {
             return(Ok());
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         _loggingService.Write(ex);
         return(InternalServerError(ex));
     }
 }