예제 #1
0
 /// <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();
 }
예제 #2
0
 /// <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));
 }
예제 #3
0
 public ApiInterfacesTypesSource(IEnumerable <Type> apiInterfaces)
 {
     ArgumentsHelpers.ThrowIfNull(apiInterfaces, nameof(apiInterfaces));
     ApiInterfaces = apiInterfaces.ToList();
 }
예제 #4
0
 /// <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;
 }