Пример #1
0
        public async Task <SongDTO> PutAsync(SongCreateDTO song)
        {
            this.Logger.LogTrace("PutAsync called");

            var result = await this.SongCreateService.CreateAsync(this.Mapper.Map <SongUpdateModel>(song));

            return(this.Mapper.Map <SongDTO>(result));
        }
Пример #2
0
        public async Task <bool> CreateSong(SongCreateDTO dto)
        {
            var rao    = _mapper.Map <SongCreateRAO>(dto);
            var engine = new SaveFileEngine();
            var uri    = engine.Upload(dto.UploadedFile);

            rao.UploadedLink = uri;

            if (await _repository.CreateSong(rao))
            {
                return(true);
            }

            throw new NotImplementedException();
        }