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)); }
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)); }
private AssignmentsCollector(AssignmentsClient client) { _client = client; }