public MainObjective CreateMainObjective(CreateMainObjectiveVM mainObjective) => Map(mainObjective, x => new MainObjective { Order = x.Order, Content = x.Name, CourseCode = x.CourseCode });
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)); } }