Skip to main content

Definition

Assembly: Microsoft.Restier.Core.dll Namespace: Microsoft.Restier.Core Inheritance: System.Object

Syntax

Microsoft.Restier.Core.ApiBase

Summary

Represents a base class for an API.

Remarks

An API configuration is intended to be long-lived, and can be statically cached according to an API type specified when the configuration is created. Additionally, the API model produced as a result of a particular configuration is cached under the same API type to avoid re-computing it on each invocation.

Constructors

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

ServiceProvider

Gets the IServiceProvider which contains all services.

Syntax

public System.IServiceProvider ServiceProvider { get; private set; }

Property Value

Type: System.IServiceProvider

Methods

Dispose

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Syntax

public void Dispose()

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetApiService Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Gets a service instance.

Syntax

public static T GetApiService<T>(Microsoft.Restier.Core.ApiBase api) where T : class

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.

Returns

Type: T The service instance.

Type Parameters

  • T - The service type.

GetApiServices Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions

Syntax

public static System.Collections.Generic.IEnumerable<T> GetApiServices<T>(Microsoft.Restier.Core.ApiBase api) where T : class

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBase-

Returns

Type: System.Collections.Generic.IEnumerable<T>

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetModel Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Retrieves the IEdmModel used by this ApiBase instance.

Syntax

public static Microsoft.OData.Edm.IEdmModel GetModel(Microsoft.Restier.Core.ApiBase api)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseThe ApiBase instance to extend.

Returns

Type: Microsoft.OData.Edm.IEdmModel The IEdmModel used by this ApiBase instance.

GetProperty Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Gets a property.

Syntax

public static T GetProperty<T>(Microsoft.Restier.Core.ApiBase api, string name)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namestringThe name of a property.

Returns

Type: T The value of the property.

Type Parameters

  • T - The type of the property.

GetProperty Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Gets a property.

Syntax

public static object GetProperty(Microsoft.Restier.Core.ApiBase api, string name)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namestringThe name of a property.

Returns

Type: object The value of the property.

GetQueryableSource Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Gets a queryable source of data using an API context.

Syntax

public static System.Linq.IQueryable GetQueryableSource(Microsoft.Restier.Core.ApiBase api, string name, params object[] arguments)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namestringThe name of an entity set, singleton or composable function import.
argumentsobject[]If name is a composable function import,
the arguments to be passed to the composable function import.

Returns

Type: System.Linq.IQueryable A queryable source.

Remarks

If the name identifies a singleton or a composable function import whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated as the API engine only operates asynchronously.

GetQueryableSource Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Gets a queryable source of data using an API context.

Syntax

public static System.Linq.IQueryable GetQueryableSource(Microsoft.Restier.Core.ApiBase api, string namespaceName, string name, params object[] arguments)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namespaceNamestringThe name of a namespace containing a composable function.
namestringThe name of a composable function.
argumentsobject[]The arguments to be passed to the composable function.

Returns

Type: System.Linq.IQueryable A queryable source.

Remarks

If the name identifies a composable function whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated, as the API engine only operates asynchronously.

GetQueryableSource Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Gets a queryable source of data using an API context.

Syntax

public static System.Linq.IQueryable<TElement> GetQueryableSource<TElement>(Microsoft.Restier.Core.ApiBase api, string name, params object[] arguments)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namestringThe name of an entity set, singleton or composable function import.
argumentsobject[]If name is a composable function import,
the arguments to be passed to the composable function import.

Returns

Type: System.Linq.IQueryable<TElement> A queryable source.

Type Parameters

  • TElement - The type of the elements in the queryable source.

Remarks

If the name identifies a singleton or a composable function import whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated, as the API engine only operates asynchronously.

GetQueryableSource Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Gets a queryable source of data using an API context.

Syntax

public static System.Linq.IQueryable<TElement> GetQueryableSource<TElement>(Microsoft.Restier.Core.ApiBase api, string namespaceName, string name, params object[] arguments)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namespaceNamestringThe name of a namespace containing a composable function.
namestringThe name of a composable function.
argumentsobject[]The arguments to be passed to the composable function.

Returns

Type: System.Linq.IQueryable<TElement> A queryable source.

Type Parameters

  • TElement - The type of the elements in the queryable source.

Remarks

If the name identifies a composable function whose result is a singleton, the resulting queryable source will be configured such that it represents exactly zero or one result. Note that the resulting queryable source cannot be synchronously enumerated, as the API engine only operates asynchronously.

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

HasProperty Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Indicates if this object has a property.

Syntax

public static bool HasProperty(Microsoft.Restier.Core.ApiBase api, string name)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namestringThe name of a property.

Returns

Type: bool true if this object has the property; otherwise, false.

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

QueryAsync Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Asynchronously queries for data using an API context.

Syntax

public static System.Threading.Tasks.Task<Microsoft.Restier.Core.Query.QueryResult> QueryAsync(Microsoft.Restier.Core.ApiBase api, Microsoft.Restier.Core.Query.QueryRequest request, System.Threading.CancellationToken cancellationToken = null)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
requestMicrosoft.Restier.Core.Query.QueryRequestA query request.
cancellationTokenSystem.Threading.CancellationTokenAn optional cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.Restier.Core.Query.QueryResult> A task that represents the asynchronous operation whose result is a query result.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

RemoveProperty Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Removes a property.

Syntax

public static void RemoveProperty(Microsoft.Restier.Core.ApiBase api, string name)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namestringThe name of a property.

SetProperty Extension

Extension method from Microsoft.Restier.Core.ApiBaseExtensions
Sets a property.

Syntax

public static void SetProperty(Microsoft.Restier.Core.ApiBase api, string name, object value)

Parameters

NameTypeDescription
apiMicrosoft.Restier.Core.ApiBaseAn API.
namestringThe name of a property.
valueobjectA value for the property.

SubmitAsync

Asynchronously submits changes made using an API context.

Syntax

public System.Threading.Tasks.Task<Microsoft.Restier.Core.Submit.SubmitResult> SubmitAsync(Microsoft.Restier.Core.Submit.ChangeSet changeSet = null, System.Threading.CancellationToken cancellationToken = null)

Parameters

NameTypeDescription
changeSetMicrosoft.Restier.Core.Submit.ChangeSetA change set, or null to submit existing pending changes.
cancellationTokenSystem.Threading.CancellationTokenAn optional cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.Restier.Core.Submit.SubmitResult> A task that represents the asynchronous operation whose result is a submit result.

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?
  • System.IDisposable