Beispiel #1
0
        private async Task <RequestResult <VideoDevEquipmentInfoOutput> > CreateAsync(EditVideoDevEquipmentInfoInput input)
        {
            var rst = new RequestResult <VideoDevEquipmentInfoOutput>()
            {
                Flag = false
            };

            try
            {
                input.CreationTime  = DateTime.Now;
                input.CreatorUserId = _currentUser.Id;
                var data = ObjectMapper.Map <VideoDevEquipmentInfo>(input);
                data = await _repository.InsertAsync(data).ConfigureAwait(false);

                rst.ResultData = ObjectMapper.Map <VideoDevEquipmentInfoOutput>(data);
                rst.Flag       = true;
            }
            catch (AutoMapperMappingException ex)
            {
                Console.WriteLine(ex.ToString());
            }
            catch
            {
            }
            return(rst);
        }
Beispiel #2
0
 public async Task <RequestResult <VideoDevEquipmentInfoOutput> > CreateOrUpdateAsync(EditVideoDevEquipmentInfoInput input)
 {
     if (input == null)
     {
         return(null);
     }
     if (_currentUser == null)
     {
         _currentUser = base.GetCurrentUser();
     }
     return(input.Id != null ? await this.UpdateAsync(input).ConfigureAwait(false) : await this.CreateAsync(input).ConfigureAwait(false));
 }