EntityServiceScope Class
Namespace: PTS.EntityLayer.Extensibility
Assembly: PTS.EntityLayer.Extensibility.dll
Default current context container for dependency injection services
Syntax
public class EntityServiceScope : IEntityServiceScope
Inheritance
System.Object
EntityServiceScope
Implements
Properties
Context
Gets context for current service scope.
Declaration
public DbContext Context { get; }
Property Value
Type | Description |
---|---|
Microsoft.EntityFrameworkCore.DbContext | Current Microsoft.EntityFrameworkCore.DbContext. |
IsLocked
Gets a value indicating whether the context can be set to a new value.
Declaration
public bool IsLocked { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ServiceProvider
Declaration
public IServiceProvider ServiceProvider { get; }
Property Value
Type | Description |
---|---|
System.IServiceProvider |
Methods
Bind(DbContext, IServiceProvider, Boolean)
Assigns context and provider instances to current service.
Declaration
public void Bind(DbContext context, IServiceProvider provider, bool lockContext)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.EntityFrameworkCore.DbContext | context | The context to set. |
System.IServiceProvider | provider | |
System.Boolean | lockContext | if set to |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown if an attempt to set the context is made on locked instance. |
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()