Skip to main content

Definition

Assembly: Microsoft.Restier.EntityFramework.dll Namespace: Microsoft.Restier.EntityFramework Inheritance: Microsoft.Restier.Core.ApiBase

Syntax

Microsoft.Restier.EntityFramework.EntityFrameworkApi<T>

Summary

Represents an API over a DbContext.

Remarks

This class tries to instantiate T with the best matched constructor base on services configured. Descendants could override by registering T as a scoped service. But in this case, proxy creation must be disabled in the constructors of T under Entity Framework 6.

Type Parameters

  • T - The DbContext type.

Constructors

.ctor

Initializes a new instance of the EntityFrameworkApi`1 class.

Syntax

public EntityFrameworkApi(System.IServiceProvider serviceProvider)

Parameters

NameTypeDescription
serviceProviderSystem.IServiceProviderAn IServiceProvider containing all services of this EntityFrameworkApi`1.

Properties

ContextType

Gets the Context Type.

Syntax

public System.Type ContextType { get; }

Property Value

Type: System.Type

DbContext

Gets the underlying DbContext for this API.

Syntax

public T DbContext { get; }

Property Value

Type: T
  • Microsoft.Restier.EntityFramework.IEntityFrameworkApi