/// <summary> /// Constructor for <see cref="ApiInterfaceAttribute"/>. /// </summary> /// <param name="assembly">Assembly where to find Api Interfaces.</param> public ApiInterfaceAttributeSource(Assembly assembly) { ArgumentsHelpers.ThrowIfNull(assembly, nameof(assembly)); ApiInterfaces = assembly.DefinedTypes .Where(t => t.GetCustomAttribute <ApiInterfaceAttribute>() != null) .ToList(); }
/// <summary> /// Call the Api Interface method. /// </summary> public Task <TOut> Call <TOut>(Expression <Func <TInterface, TOut> > methodCall) { ArgumentsHelpers.ThrowIfNull(methodCall, nameof(methodCall)); return(Call <TOut>(methodCall.Body)); }
public ApiInterfacesTypesSource(IEnumerable <Type> apiInterfaces) { ArgumentsHelpers.ThrowIfNull(apiInterfaces, nameof(apiInterfaces)); ApiInterfaces = apiInterfaces.ToList(); }
/// <summary> /// Call the Api Interface method. /// </summary> public Task Call(Expression <Action <TInterface> > methodCall) { ArgumentsHelpers.ThrowIfNull(methodCall, nameof(methodCall)); return(Call((MethodCallExpression)methodCall.Body)); }
public ApiConventionException(Type issuedApiInterfaceType) { ArgumentsHelpers.ThrowIfNull(issuedApiInterfaceType, nameof(issuedApiInterfaceType)); IssuedApiInterfaceType = issuedApiInterfaceType; }