Example #1
0
 private async Task <TiqetEventTicketDetailMapping> SaveToTiqetsEventTicketDetailMapping(long tiqetVariantId, long eventTicketDetailId, UpdateProductCommand command)
 {
     // Saving to EventTicketdetail Mapping goes here.
     try
     {
         var eventTicketDetailMapping = _tiqetEventTicketDetailMappingRepository.GetByTiqetVariantId(tiqetVariantId);
         if (eventTicketDetailMapping == null)
         {
             eventTicketDetailMapping = _tiqetEventTicketDetailMappingRepository.Save(new TiqetEventTicketDetailMapping
             {
                 TiqetVariantDetailId = tiqetVariantId,
                 EventTicketDetailId  = eventTicketDetailId,
                 IsEnabled            = true,
                 ProductId            = command.productId,
                 ModifiedBy           = command.ModifiedBy,
                 CreatedUtc           = DateTime.UtcNow
             });
         }
         else
         {
             eventTicketDetailMapping.IsEnabled = true;
             _tiqetEventTicketDetailMappingRepository.Save(eventTicketDetailMapping);
         }
         return(eventTicketDetailMapping);
     }
     catch (Exception e)
     {
         _logger.Log(LogCategory.Error, new Exception("Failed to save to eventticketdetail mappings", e));
         return(null);
     }
 }