Show / Hide Table of Contents

Class RestProxy

Base proxy class. Derived classes implement the specfic rest/http communication mechanisms. Each node in a chain of proxy instances represents a specific endpoint

Inheritance
Object
DynamicObject
RestProxy
DynamicRestClient
Implements
IDynamicMetaObjectProvider
Inherited Members
System.Dynamic.DynamicObject.GetDynamicMemberNames()
System.Dynamic.DynamicObject.GetMetaObject(System.Linq.Expressions.Expression)
System.Dynamic.DynamicObject.TryBinaryOperation(System.Dynamic.BinaryOperationBinder, System.Object, System.Object)
System.Dynamic.DynamicObject.TryConvert(System.Dynamic.ConvertBinder, System.Object)
System.Dynamic.DynamicObject.TryCreateInstance(System.Dynamic.CreateInstanceBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryDeleteIndex(System.Dynamic.DeleteIndexBinder, System.Object[])
System.Dynamic.DynamicObject.TryDeleteMember(System.Dynamic.DeleteMemberBinder)
System.Dynamic.DynamicObject.TryGetIndex(System.Dynamic.GetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TrySetIndex(System.Dynamic.SetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TrySetMember(System.Dynamic.SetMemberBinder, System.Object)
System.Dynamic.DynamicObject.TryUnaryOperation(System.Dynamic.UnaryOperationBinder, System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: DynamicRestProxy
Assembly: DynamicRestProxy.NetStandard.dll
Syntax
public abstract class RestProxy : DynamicObject, IDynamicMetaObjectProvider

Constructors

| Improve this Doc View Source

RestProxy(RestProxy, String)

ctor

Declaration
protected RestProxy(RestProxy parent, string name)
Parameters
Type Name Description
RestProxy parent Parent
String name Name

Fields

| Improve this Doc View Source

_verbs

List of supported Http verbs. Currently "post", "get", "delete", "put", "patch"

Declaration
protected static readonly string[] _verbs
Field Value
Type Description
String[]

Properties

| Improve this Doc View Source

BaseUri

The base Url of the endpoint. Overridden in derived classes to allow specific rest client to determine how it is stored

Declaration
protected abstract Uri BaseUri { get; }
Property Value
Type Description
Uri
| Improve this Doc View Source

Name

The name of this node. This is the text used when forming the complete Url

Declaration
public string Name { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Parent

The parent of this node

Declaration
public RestProxy Parent { get; }
Property Value
Type Description
RestProxy

Methods

| Improve this Doc View Source

CreateProxyNode(RestProxy, String)

Factory method used to create instances of derived child nodes. Overriden in derived classes to create derived instances

Declaration
protected abstract RestProxy CreateProxyNode(RestProxy parent, string name)
Parameters
Type Name Description
RestProxy parent

The parent of the newly created child

String name

The name of the newly created child

Returns
Type Description
RestProxy

Derived child instance

| Improve this Doc View Source

CreateVerbAsyncTask<T>(String, IEnumerable<Object>, IEnumerable<KeyValuePair<String, Object>>, CancellationToken, JsonSerializerSettings)

Abstract method to create a Task that will execute the necessary http communication

Declaration
protected abstract Task<T> CreateVerbAsyncTask<T>(string verb, IEnumerable<object> unnamedArgs, IEnumerable<KeyValuePair<string, object>> namedArgs, CancellationToken cancelToken, JsonSerializerSettings serializationSettings)
Parameters
Type Name Description
String verb

The http verb to execute (must be get, post, put, patch or delete)

System.Collections.Generic.IEnumerable<Object> unnamedArgs

Unnamed arguments passed to the invocation. These go into the http request body

System.Collections.Generic.IEnumerable<KeyValuePair<String, Object>> namedArgs

Named arguments supplied to the invocation. These become http request parameters

CancellationToken cancelToken

A CancellationToken for the async operations

Newtonsoft.Json.JsonSerializerSettings serializationSettings

Settings to use for response deserialization

Returns
Type Description
System.Threading.Tasks.Task<T>

Task{dynamic} that will execute the http call and return a dynamic object with the results

Type Parameters
Name Description
T
| Improve this Doc View Source

Equals(Object)

System.Object.Equals(System.Object)
Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean

compares the complete url as a string to obj

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetEndPointPath()

The relative Url (minus parameters) for this endpoint

Declaration
public string GetEndPointPath()
Returns
Type Description
String

The relative part of the url (relative to BaseUri)

| Improve this Doc View Source

GetEndPointPath(StringBuilder)

Used to generate a relative Url for the endpoint

Declaration
protected void GetEndPointPath(StringBuilder builder)
Parameters
Type Name Description
StringBuilder builder
| Improve this Doc View Source

GetHashCode()

System.Object.GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

ToString()

System.Object.ToString()
Declaration
public override string ToString()
Returns
Type Description
String

The full Url of this node in the path chain

Overrides
System.Object.ToString()
| Improve this Doc View Source

TryGetMember(GetMemberBinder, out Object)

System.Dynamic.DynamicObject.TryGetMember(System.Dynamic.GetMemberBinder, System.Object)
Declaration
public override bool TryGetMember(GetMemberBinder binder, out object result)
Parameters
Type Name Description
GetMemberBinder binder
Object result
Returns
Type Description
Boolean
Overrides
System.Dynamic.DynamicObject.TryGetMember(System.Dynamic.GetMemberBinder, System.Object)
| Improve this Doc View Source

TryInvoke(InvokeBinder, Object[], out Object)

System.Dynamic.DynamicObject.TryInvoke(System.Dynamic.InvokeBinder, System.Object[], System.Object)
Declaration
public override bool TryInvoke(InvokeBinder binder, object[] args, out object result)
Parameters
Type Name Description
InvokeBinder binder
Object[] args
Object result
Returns
Type Description
Boolean
Overrides
System.Dynamic.DynamicObject.TryInvoke(System.Dynamic.InvokeBinder, System.Object[], System.Object)
| Improve this Doc View Source

TryInvokeMember(InvokeMemberBinder, Object[], out Object)

System.Dynamic.DynamicObject.TryInvokeMember(System.Dynamic.InvokeMemberBinder, System.Object[], System.Object)
Declaration
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
Parameters
Type Name Description
InvokeMemberBinder binder
Object[] args
Object result
Returns
Type Description
Boolean
Overrides
System.Dynamic.DynamicObject.TryInvokeMember(System.Dynamic.InvokeMemberBinder, System.Object[], System.Object)

Operators

| Improve this Doc View Source

Explicit(RestProxy to Uri)

Returns an Uri represtation of the full Url

Declaration
public static explicit operator Uri(RestProxy proxy)
Parameters
Type Name Description
RestProxy proxy
Returns
Type Description
Uri
| Improve this Doc View Source

Implicit(RestProxy to String)

Convert the RestProxy to its full url as a string

Declaration
public static implicit operator string (RestProxy proxy)
Parameters
Type Name Description
RestProxy proxy
Returns
Type Description
String

Implements

IDynamicMetaObjectProvider
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX