Beispiel #1
0
 public async Task CreateOrEdit(CreateOrEditTrainDto input)
 {
     if (input.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }
Beispiel #2
0
        protected virtual async Task Create(CreateOrEditTrainDto input)
        {
            var train = ObjectMapper.Map <Train>(input);


            if (AbpSession.TenantId != null)
            {
                train.TenantId = (int)AbpSession.TenantId;
            }


            await _trainRepository.InsertAsync(train);
        }
Beispiel #3
0
        protected virtual async Task Update(CreateOrEditTrainDto input)
        {
            var train = await _trainRepository.FirstOrDefaultAsync((Guid)input.Id);

            ObjectMapper.Map(input, train);
        }