예제 #1
0
파일: AdminService.cs 프로젝트: rstens/hets
        public IActionResult AdminObfuscateGetAsync(string sourcePath, string destinationPath)
        {
            string result = "Created Obfuscation Job: ";

            lock (_thisLock)
            {
                string uploadPath       = _configuration["UploadPath"];
                string connectionString = _context.Database.GetDbConnection().ConnectionString;

                ImportUtility.CreateObfuscationDestination(uploadPath + destinationPath);

                // use Hangfire
                string jobId = BackgroundJob.Enqueue(() => BcBidImport.ObfuscationJob(null, connectionString, uploadPath + sourcePath, uploadPath + destinationPath));
                result += jobId;
            }

            return(new ObjectResult(result));
        }
예제 #2
0
        public virtual IActionResult AdminObfuscateGet([FromQuery] string sourcePath, [FromQuery] string destinationPath)
        {
            string result = "Created Obfuscation Job: ";

            lock (_thisLock)
            {
                // get upload path
                string uploadPath = _configuration["UploadPath"];

                // get connection string
                string connectionString = GetConnectionString();

                ImportUtility.CreateObfuscationDestination(uploadPath + destinationPath);

                // use Hangfire
                string jobId = BackgroundJob.Enqueue(() => BcBidImport.ObfuscationJob(null, connectionString, uploadPath + sourcePath, uploadPath + destinationPath));
                result += jobId;
            }

            return(new ObjectResult(result));
        }