Exemplo n.º 1
0
        public static async Task PublicarEventos(this IMediatrHandler mediator, PagamentoContext ctx)
        {
            var domainEntities = ctx.ChangeTracker
                                 .Entries <Entity>()
                                 .Where(x => x.Entity.Notificacoes != null && x.Entity.Notificacoes.Any());

            var domainEvents = domainEntities
                               .SelectMany(x => x.Entity.Notificacoes)
                               .ToList();

            domainEntities.ToList()
            .ForEach(entity => entity.Entity.LimparEventos());

            var tasks = domainEvents
                        .Select(async(domainEvent) => {
                await mediator.PublicarEvento(domainEvent);
            });

            await Task.WhenAll(tasks);
        }
Exemplo n.º 2
0
 public static void Initialize(PagamentoContext context)
 {
     context.Database.EnsureCreated();
 }
 public PagamentoRepository(PagamentoContext context) : base(context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public RepositorioBase(PagamentoContext pagamentoContext)
 {
     _pagamentoContext = pagamentoContext;
 }
Exemplo n.º 5
0
 public PagamentoService(ApplicationDbContext _context, PagamentoContext _pagamentocontext)
 {
     context          = _context;
     pagamentocontext = _pagamentocontext;
 }
Exemplo n.º 6
0
 public PagamentosController(PagamentoContext context)
 {
     this.context = context;
 }
Exemplo n.º 7
0
 public PagamentoRepositorio(PagamentoContext pagamentoContext) : base(pagamentoContext)
 {
     _pagamentoContext = pagamentoContext;
 }