protected virtual async Task Create(CreateEditIndicatorAndTargetDto input)
        {
            var indicator = ObjectMapper.Map <PerformanceIndicator>(input.Indicator);
            var id        = await _performanceIndicatorRepository.InsertAndGetIdAsync(indicator);

            await SaveYearlyTargets(id, input.YearlyTarget);
        }
        protected virtual async Task Update(CreateEditIndicatorAndTargetDto input)
        {
            var indicator = await _performanceIndicatorRepository.FirstOrDefaultAsync((int)input.Indicator.Id);

            ObjectMapper.Map(input.Indicator, indicator);
            await SaveYearlyTargets(indicator.Id, input.YearlyTarget);
            await RemoveYearlyTarget(indicator.Id, input.YearlyTarget);
        }
 public async Task CreateOrEdit(CreateEditIndicatorAndTargetDto input)
 {
     if (input.Indicator.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }