public async Task EditMainObjective(MainObjectiveView mainObjectiveView) { var mainObjective = await _mainObjectiveRepository.Get(mainObjectiveView.Id); mainObjective.Id = mainObjectiveView.Id; mainObjective.Title = mainObjectiveView.Title; mainObjective.Description = mainObjectiveView.Description; mainObjective.DeadLine = mainObjectiveView.Deadline; await _mainObjectiveRepository.Update(mainObjective); }
public async Task <MainObjectiveView> AddMainObjective(MainObjectiveView mainObjectiveView, long categoryId) { var mainObjective = Mapper.Map <MainObjectiveView, MainObjective>(mainObjectiveView); mainObjective.CategoryId = categoryId; mainObjective.Status = ObjectiveStatus.New; var newMainObjective = await _mainObjectiveRepository.Add(mainObjective); var newMainObjectiveView = Mapper.Map <MainObjective, MainObjectiveView>(newMainObjective); return(newMainObjectiveView); }
public async Task <string> EditMainObjective([FromBody] MainObjectiveView mainObjectiveView) { await _dashboardService.EditMainObjective(mainObjectiveView); return(""); }