Exemplo n.º 1
0
 public async Task <int> Create(QnAVideoViewModel model)
 {
     try {
         QnAVideo qnAVideo = new QnAVideo()
         {
             EmbedURL = model.EmbedURL,
             EmbedKey = model.EmbedKey,
             IsActive = true,
             QAId     = model.QAId,
             Title    = model.Title
         };
         return((await _IQnAVideoRepository.AddAsync(qnAVideo)).Id);
     }
     catch (Exception ex) {
         return(0);
     }
 }
        public async Task <IActionResult> QnAVideo([FromForm] QnAVideoCreateViewModel model)
        {
            QnAVideoViewModel _QnAVideoViewModel = new QnAVideoViewModel();

            _QnAVideoViewModel.QAId  = model.QAId;
            _QnAVideoViewModel.Title = model.Title;

            _QnAVideoViewModel.EmbedKey = model.EmbedKey;
            _QnAVideoViewModel.EmbedURL = model.EmbedURL;

            int id = await _IQnAVideoService.Create(_QnAVideoViewModel);

            return(Ok(new
            {
                id = id
            }));
        }