Owneat Technical Guide main Help

Class RestaurantUnitOfWork

Namespace: Restaurant.Infrastructure.Persistence
Assembly: Restaurant.Infrastructure.dll

public class RestaurantUnitOfWork : IUnitOfWork

Inheritance

object ← RestaurantUnitOfWork

Implements

IUnitOfWork

Inherited Members

object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.MemberwiseClone\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)

Constructors

RestaurantUnitOfWork\(RestaurantContext, IDomainEventsDispatcher\)

public RestaurantUnitOfWork(RestaurantContext restaurantContext, IDomainEventsDispatcher domainEventsDispatcher)

Parameters

restaurantContext RestaurantContext

domainEventsDispatcher IDomainEventsDispatcher

Methods

CommitAsync\(CancellationToken\)

Method that dispatch all events and sync all the changes currently running on DBContext and execute them.

public Task<int> CommitAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token used to cancel operation if needed.

Returns

Task < int \>

The number of entities modified.

Last modified: 21 May 2024