Definition
Assembly: CloudNimble.EasyAF.Restier.EF6.dll Namespace: CloudNimble.EasyAF.Restier Inheritance: Microsoft.Restier.EntityFramework.EntityFrameworkApi<TContext>Syntax
Summary
Provides a base implementation of an Entity Framework API for EasyAF, integrating SimpleMessageBus event publishing and logging capabilities. This class extends EntityFrameworkApi`1 and is intended to be used as a base class for APIs that require access to the current HTTP context, logging, and SimpleMessageBus publishing.Type Parameters
TContext- The type of the DbContext used by the API.
Examples
Constructors
.ctor
Initializes a new instance of theEasyAFEntityFrameworkApi1` class.
Syntax
Parameters
| Name | Type | Description |
|---|---|---|
serviceProvider | System.IServiceProvider | The service provider for dependency injection. |
httpContextAccessor | Microsoft.AspNetCore.Http.IHttpContextAccessor | The IHttpContextAccessor for the current HTTP context. |
messagePublisher | CloudNimble.SimpleMessageBus.Publish.IMessagePublisher | The IMessagePublisher used for publishing messages to SimpleMessageBus. |
logger | Microsoft.Extensions.Logging.ILogger<CloudNimble.EasyAF.Restier.EasyAFEntityFrameworkApi<TContext>> | The ILogger`1 instance for writing log traces. |
Exceptions
| Exception | Description |
|---|---|
ArgumentNullException | Thrown if httpContextAccessor or messagePublisher is null. |
Properties
HttpContextAccessor
Gets or sets the accessor for the current HTTP context. Used to access HTTP-specific information about the current request.Syntax
Property Value
Type:Microsoft.AspNetCore.Http.IHttpContextAccessor
Logger
Gets or sets the ILogger`1 instance used for writing log traces.Syntax
Property Value
Type:Microsoft.Extensions.Logging.ILogger<CloudNimble.EasyAF.Restier.EasyAFEntityFrameworkApi<TContext>>
MessagePublisher
Gets or sets theIMessagePublisher used for publishing messages to SimpleMessageBus.
Syntax
Property Value
Type:CloudNimble.SimpleMessageBus.Publish.IMessagePublisher