Exemplo n.º 1
0
        public static async Task DispatchDomainEventsAsync(this IMediator mediator, GDOCContext ctx)
        {
            var domainEntities = ctx.ChangeTracker
                                 .Entries <Entity>()
                                 .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);
            }
        }
Exemplo n.º 2
0
 public StoreValidator(GDOCContext _db, List <Stores> _store)
 {
     db     = _db;
     Stores = _store;
 }
Exemplo n.º 3
0
 public StoreValidator(GDOCContext _db, Stores _store)
 {
     db    = _db;
     Store = _store;
 }
Exemplo n.º 4
0
 public StoreValidator(GDOCContext _db)
 {
     db = _db;
 }
Exemplo n.º 5
0
 public BOStores(GDOCContext _db, List <Stores> _store)
 {
     db             = _db;
     Stores         = _store;
     StoreValidator = new StoreValidator(_db, _store);
 }
Exemplo n.º 6
0
 public BOStores(GDOCContext _db)
 {
     db             = _db;
     StoreValidator = new StoreValidator(_db);
 }
Exemplo n.º 7
0
 public BOStores(GDOCContext _db, Stores _store)
 {
     db             = _db;
     Store          = _store;
     StoreValidator = new StoreValidator(_db, _store);
 }
Exemplo n.º 8
0
 public StoresController(GDOCContext context, ILogger <StoresController> logger, IConfiguration Configuration, IStoreService storeService) =>
 (_context, _logger, _IConfiguration, _Store) =
Exemplo n.º 9
0
 public PanesService(GDOCContext context, HttpClient httpClient)
 {
     _context    = context ?? throw new ArgumentNullException(nameof(context));
     _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
 }
Exemplo n.º 10
0
 public PanesController(GDOCContext context, IPanesService panes)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
     _panes   = panes ?? throw new ArgumentNullException(nameof(panes));
 }