Beispiel #1
0
        public async Task <ReplayFileApiModel> PostAsync(IFormFile file)
        {
            var replayFile = new DataFile();

            try
            {
                var content = this.replayFileService.ValidateFile(file.OpenReadStream());
                replayFile.Content = content;
                replayFile.Name    = file.FileName;
            }
            catch (Exception e)
            {
                throw new BadRequestException(e.Message);
            }

            return(ReplayFileApiModel.FromServiceModel(await this.replayFileService.InsertAsync(replayFile)));
        }
Beispiel #2
0
 public async Task <ReplayFileApiModel> GetAsync(string id)
 {
     return(ReplayFileApiModel.FromServiceModel(await this.replayFileService.GetAsync(id)));
 }