TypedRest for .NET 1.3.6
build type-safe fluent-style REST API clients
TypedRest.TypeExtensions Class Reference

Provides extension methods for Type. More...

Static Public Member Functions

static ? Func< T1, T2, TResult > GetConstructor< T1, T2, TResult > ()
 Returns a constructor for TResult with two arguments as a function. More...
 
static ? PropertyInfo GetPropertyWith< TAttribute > (this Type type)
 Gets a property defined on a type that is annotated with a specific TAttribute . More...
 
static Func< TSource, TResult > ToFunc< TSource, TResult > (this MethodInfo method)
 Converts a method into a function that takes the object instance as a parameter. More...
 

Detailed Description

Provides extension methods for Type.

Member Function Documentation

◆ GetConstructor< T1, T2, TResult >()

static ? Func< T1, T2, TResult > TypedRest.TypeExtensions.GetConstructor< T1, T2, TResult > ( )
inlinestatic

Returns a constructor for TResult with two arguments as a function.

Template Parameters
T1The type of the first constructor argument.
T2The type of the second constructor argument.
TResultThe type to construct.
Returns
The function; null if no suitable constructor was found.

◆ GetPropertyWith< TAttribute >()

static ? PropertyInfo TypedRest.TypeExtensions.GetPropertyWith< TAttribute > ( this Type  type)
static

Gets a property defined on a type that is annotated with a specific TAttribute .

Returns
The property; null if no such property was found.
Type Constraints
TAttribute :Attribute 
TAttribute :type.GetProperties 
TAttribute :BindingFlags.Instance 
TAttribute :BindingFlags.Public 
TAttribute :FirstOrDefault 
TAttribute :x 
TAttribute :x.GetCustomAttribute<TAttribute> 
TAttribute :inherit 
TAttribute :true 
TAttribute :null 

◆ ToFunc< TSource, TResult >()

static Func< TSource, TResult > TypedRest.TypeExtensions.ToFunc< TSource, TResult > ( this MethodInfo  method)
inlinestatic

Converts a method into a function that takes the object instance as a parameter.

Template Parameters
TSourceThe type of the class defining the method.
TResultThe return type of the method.

The documentation for this class was generated from the following file: