protected async Task SaveProgressLog(CreateOrEditPerformanceActivityDto input, PerformanceActivity activity)
 {
     await _activityProgressLogRepository.InsertAsync(new ActivityUpdateLog
     {
         PerformanceActivityId = (int)input.Id,
         CompletionLevel       = input.CompletionLevel,
         OriginalValue         = activity.CompletionLevel == null ? 0 : (int)activity.CompletionLevel,
         DataSource            = input.DataSource,
         Notes = input.Note,
     });
 }
 public async Task CreateOrEdit(CreateOrEditPerformanceActivityDto input)
 {
     if (input.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }
        protected virtual async Task Update(CreateOrEditPerformanceActivityDto input)
        {
            var activity = await _performanceActivityRepository.FirstOrDefaultAsync((int)input.Id);

            ObjectMapper.Map(input, activity);
        }
 protected virtual async Task Create(CreateOrEditPerformanceActivityDto input)
 {
     var activity = ObjectMapper.Map <PerformanceActivity>(input);
     await _performanceActivityRepository.InsertAsync(activity);
 }