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"); }