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; }
public void SaveFile(FileEntity file) { repository.Save(file.ToDalFile()); store.Upload(file.Data, file.Path, file.Name); }