示例#1
0
        public static async Task Authenticate(this IJudge0Service service, Judge0Options options)
        {
            {
                var result = await service.AuthenticationService.Authenticate(options.AuthenticationToken);

                if (!result.Result)
                {
                    throw new Exception("Judge0 Authenticate failed.");
                }
            }
            {
                var result = await service.AuthenticationService.Authorize(options.AuthorizationToken);

                if (!result.Result)
                {
                    throw new Exception("Judge0 Authorize failed.");
                }
            }
        }
示例#2
0
 public JudgerController(IOptions<Judge0Options> options, IJudge0Service judge0)
 {
     Options = options.Value;
     Judge0 = judge0;
 }