Beispiel #1
0
        public void CreateFile()
        {
            if (string.IsNullOrEmpty(FileName))
            {
                ErrorMessage = "File Name is Null";
                return;
            }

            _fileRepository = new FileRepository(FileName);
            _fileRepository.CreateFile(FileName);
            _watcher             = new Watcher(FileName);
            _watcher.FileChange += FileCangedHandler;
            FileStatus           = FileStatus.Created;
        }
        public async Task <CreateFileResponse> Do(CreateFileRequest request)
        {
            File file = new File
            {
                MimeType   = request.MimeType,
                Filename   = request.Filename,
                UploadTime = request.UploadTime,
            };

            if (await _fileRepository.CreateFile(file) <= 0)
            {
                throw new Exception("Failed to create File");
            }

            return(new CreateFileResponse
            {
                Id = file.Id,
                Filename = file.Filename,
                UploadTime = file.UploadTime,
                MimeType = file.MimeType,
            });
        }
Beispiel #3
0
 public void CreateFile()
 {
     _fileRepo.fileName = "Palash_Kanti";
     _fileRepo.CreateFile();
 }