Пример #1
0
        public async Task <bool> SaveNotes(SessionBto Session, byte[] Notes)
        {
            //Get full path
            string completeSavePath = GetFullPath(Session);

            //Save file
            File.WriteAllBytes(completeSavePath, Notes);
            await Task.CompletedTask;

            return(true);
        }
Пример #2
0
        public async Task <byte[]> OpenNotes(SessionBto Session)
        {
            byte[] returnValue      = null;
            string completeOpenPath = GetFullPath(Session); //Get complete path

            if (File.Exists(completeOpenPath))
            {
                returnValue = File.ReadAllBytes(completeOpenPath);
            }

            await Task.CompletedTask;

            return(returnValue);
        }
Пример #3
0
 private string GetFullPath(SessionBto Session) =>
 Path.Combine(GetFileStoredFolder(), GetFileName(Session));
Пример #4
0
 private string GetFileName(SessionBto Session) => $"{Session.ModuleId}_{Session.Id}.docx";