public async Task <ApiResponseAsync <bool> > CreatePageContent(CreateContentDTO dto) { await this._body.Create(dto.NotesId, dto.SectionId, dto.PageId, dto.Cotnent); return(ApiRes.OK(true)); }
public async Task Create(CreateContentViewModel input) { try { string mainImageUrl = await _blobManager.UploadImageAsBlob(input.MainImage); string slideImageUrl = await _blobManager.UploadImageAsBlob(input.SlideImage); string videoUrl = await _blobManager.UploadImageAsBlob(input.Video); string audioUrl = await _blobManager.UploadImageAsBlob(input.Audio); CreateContentDTO data = new CreateContentDTO() { Name = input.Name, Description = input.Description, Title = input.Title, MainImageURL = mainImageUrl, SlideImageURL = slideImageUrl, VideoURL = videoUrl, AudioURL = audioUrl, IsHomePage = input.IsHomePage, IsCampaign = input.IsCampaign, Text = input.Text, LocationId = input.LocationId }; await _contentService.CrateContent(data); } catch (Exception e) { throw e; } }
public async Task CrateContent(CreateContentDTO input) { var content = _mapper.Map <Content>(input); content.Location = await _locationRepository.GetById(input.LocationId); await _repository.Create(content); }
public async Task <IActionResult> CreateContent(CreateContentDTO input) { try { await _contentService.CrateContent(input); return(Ok()); } catch (Exception) { throw; } }