Ejemplo n.º 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();
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 3
0
 public ApiInterfacesTypesSource(IEnumerable <Type> apiInterfaces)
 {
     ArgumentsHelpers.ThrowIfNull(apiInterfaces, nameof(apiInterfaces));
     ApiInterfaces = apiInterfaces.ToList();
 }
Ejemplo n.º 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;
 }