コード例 #1
0
ファイル: MaterialsService.cs プロジェクト: why-7/Matbox
        public async Task <string> AddNewVersionOfMaterial(FilesDto dto)
        {
            if (_dbService.GetCountOfMaterials(dto.uploadedFile.FileName) == 0)
            {
                throw new MaterialNotInDbException("Material " + dto.uploadedFile.FileName +
                                                   " is not in the database.");
            }

            await _dbService.AddNewVersionOfMaterialToDb(dto, GenRandomNameInLocalStorage());

            return("New version of material" + dto.uploadedFile.FileName + " was upload");
        }