コード例 #1
0
            public IAsyncCollector <Models.Assignment> Convert(AssignmentAttribute attribute)
            {
                string baseServiceUriString = Environment.GetEnvironmentVariable(attribute.ServiceUrlEnvironmentVariable);

                if (string.IsNullOrEmpty(baseServiceUriString))
                {
                    throw new ArgumentException("Assignment service URL was not provided.");
                }

                AssignmentsClient assignmentsClient = _assignmentClientFactory.CreateClient(baseServiceUriString);

                return(new AssignmentsCollector(assignmentsClient));
            }
コード例 #2
0
        private Task <Models.Assignment> ConvertToAssignment(AssignmentAttribute attribute, ValueBindingContext context)
        {
            string baseServiceUriString = Environment.GetEnvironmentVariable(attribute.ServiceUrlEnvironmentVariable);

            if (string.IsNullOrEmpty(baseServiceUriString))
            {
                throw new ArgumentException("Assignment service URL was not provided.");
            }

            AssignmentsClient assignmentsClient = _assignmentClientFactory.CreateClient(baseServiceUriString);

            return(assignmentsClient.GetAssignment(attribute.AssignmentId));
        }
コード例 #3
0
 private AssignmentsCollector(AssignmentsClient client)
 {
     _client = client;
 }