public static async Task DispatchDomainEventsAsync(this IMediator mediator, OrderLunchContext context) { var domainEntities = context.ChangeTracker .Entries <BaseEntity>().Where(x => x.Entity.DomainEvents != null && x.Entity.DomainEvents.Any()); var domainEvents = domainEntities .SelectMany(x => x.Entity.DomainEvents) .ToList(); domainEntities.ToList() .ForEach(entity => entity.Entity.ClearDomainEvents()); foreach (var domainEvent in domainEvents) { await mediator.Publish(domainEvent); } }
public MenuRepository(OrderLunchContext dbContext) : base(dbContext) { }
public BasketRepository(OrderLunchContext context) { _dbContext = context ?? throw new ArgumentNullException(nameof(context)); }
public RequestManager(OrderLunchContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }
public BuyerRepository(OrderLunchContext dbContext) : base(dbContext) { }
public SupplierRepository(OrderLunchContext dbContext) : base(dbContext) { }