示例#1
0
        public FileWrapper <T> UpdateFile(T fileId, string title, int lastVersion)
        {
            if (!string.IsNullOrEmpty(title))
            {
                FileStorageService.FileRename(fileId, title);
            }

            if (lastVersion > 0)
            {
                FileStorageService.UpdateToVersion(fileId, lastVersion);
            }

            return(GetFileInfo(fileId));
        }
        public FileWrapper <T> UpdateFile(T fileId, string title, int lastVersion)
        {
            File <T> newFile = null;

            if (!string.IsNullOrEmpty(title))
            {
                newFile = FileStorageService.FileRename(fileId, title);
            }

            if (lastVersion > 0)
            {
                var pair = FileStorageService.UpdateToVersion(fileId, lastVersion);
                newFile = pair.Key;
            }

            return(newFile != null?FileWrapperHelper.Get(newFile) : GetFileInfo(fileId));
        }