public async Task <TitleImages> Create(TitleImages inputModel) { try { var result = await _unitOfWork.TitleImagesRepository.Add(inputModel); await _unitOfWork.SaveChange(); return(result); } catch (Exception ex) { throw ex; } }
private async Task Create_TitleImage(long contentId, string titleImg, int?titleImgWidth, int?titleImgHeight) { try { var data = new TitleImages(); data.ContentId = contentId; data.Url = titleImg; data.Width = titleImgWidth; data.Height = titleImgHeight; await _titleImagesManager.Create(data); } catch (Exception ex) { StatusCode(500, ex.Message); } }
public async Task Update(TitleImages inputModel) { await _unitOfWork.CreateTransaction(); try { await _unitOfWork.TitleImagesRepository.Update(inputModel); await _unitOfWork.Commit(); await _unitOfWork.SaveChange(); } catch (Exception ex) { await _unitOfWork.Rollback(); throw ex; } }
public IEnumerator ShowTitleImage(TitleImages titleImage) { //Play the titles' sound if (musicManager) { musicManager.PlayTitleEffect(titleImage); } // Show and animate the title image.enabled = true; image.sprite = titles [(int)titleImage]; if (titleImage == TitleImages.Goal) { iTween.ShakeScale(gameObject, new Vector3(0.2f, 0.2f, 0f), animationTime); } else { iTween.ScaleTo(gameObject, iTween.Hash("x", 1.2f, "y", 1.2f, "time", animationTime / 2, "easeType", "easeInOutQuad")); } yield return(new WaitForSeconds(animationTime)); image.enabled = false; }