internal Task <IValueBinder> BindForItemAsync(FunctionsHttpClientAttribute attribute, Type type) { if (string.IsNullOrWhiteSpace(attribute?.RequestUrl)) { throw new InvalidOperationException($"{nameof(attribute.RequestUrl)} cannot be null"); } FunctionsHttpClientContext context = CreateContext(attribute); if (type == typeof(string)) { return(Task.FromResult <IValueBinder>(new FunctionsHttpClientItemValueBinderString(CreateContext(attribute)))); } Type genericType = typeof(FunctionsHttpClientItemValueBinder <>).MakeGenericType(type); IValueBinder binder = (IValueBinder)Activator.CreateInstance(genericType, context); return(Task.FromResult(binder)); }
public FunctionsHttpClientItemValueBinder(FunctionsHttpClientContext context) { _context = context; }
public FunctionsHttpClientCollectorBinder(FunctionsHttpClientContext context) { _context = context; }