Пример #1
0
        public virtual async Task InsertFile(IFile file)
        {
            var temp = new File();

            temp.CopyFrom(file);
            await Files.AddAsync(temp);

            await SaveChangesAsync(true);
        }
Пример #2
0
        public async Task <IFile> CreateFile(IDirectory directory, string name, byte[] data)
        {
            var file = new File(directory, name);

            file.Content = new Content(data);

            await Files.AddAsync(file);

            await SaveChangesAsync(true);

            return(file);
        }