示例#1
0
 public FileEntity CreateFileEntity(byte[] stream, string fileName, bool isPublic, Guid ownerId, long size, string filePath)
 {
     var file = new FileEntity()
         {
            // Id = Guid.NewGuid(),
             Data = stream,
             Name = fileName,
             IsPublic = isPublic,
             OwnerId = ownerId,
             Path = filePath,
             Size = size,
             UploadDate = DateTime.Now
         };
     return file;
 }
示例#2
0
 public void SaveFile(FileEntity file)
 {
     repository.Save(file.ToDalFile());
     store.Upload(file.Data, file.Path, file.Name);
 }