Exemplo n.º 1
0
        public override async System.Threading.Tasks.ValueTask <EventSourcingTests.Bugs.Bug_1679_use_inner_type_for_self_aggregate.InnerAggregate> ApplyEvent(Marten.IQuerySession session, Marten.Events.Projections.EventSlice <EventSourcingTests.Bugs.Bug_1679_use_inner_type_for_self_aggregate.InnerAggregate, System.Guid> slice, Marten.Events.IEvent evt, EventSourcingTests.Bugs.Bug_1679_use_inner_type_for_self_aggregate.InnerAggregate aggregate, System.Threading.CancellationToken cancellationToken)
        {
            switch (evt)
            {
            case Marten.Events.IEvent <EventSourcingTests.EventA> event_EventA96:
                aggregate ??= new EventSourcingTests.Bugs.Bug_1679_use_inner_type_for_self_aggregate.InnerAggregate();
                aggregate.Apply(event_EventA96.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.EventB> event_EventB97:
                aggregate ??= new EventSourcingTests.Bugs.Bug_1679_use_inner_type_for_self_aggregate.InnerAggregate();
                aggregate.Apply(event_EventB97);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.EventC> event_EventC98:
                aggregate ??= new EventSourcingTests.Bugs.Bug_1679_use_inner_type_for_self_aggregate.InnerAggregate();
                aggregate = aggregate.Apply(event_EventC98);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.EventD> event_EventD99:
                aggregate ??= new EventSourcingTests.Bugs.Bug_1679_use_inner_type_for_self_aggregate.InnerAggregate();
                aggregate = await aggregate.Apply(event_EventD99.Data, session);

                return(aggregate);
            }

            return(aggregate);
        }
        public override async System.Threading.Tasks.ValueTask <EventSourcingTests.Aggregation.RoomsAvailability> ApplyEvent(Marten.IQuerySession session, Marten.Events.Projections.EventSlice <EventSourcingTests.Aggregation.RoomsAvailability, System.Guid> slice, Marten.Events.IEvent evt, EventSourcingTests.Aggregation.RoomsAvailability aggregate, System.Threading.CancellationToken cancellationToken)
        {
            switch (evt)
            {
            case Marten.Events.IEvent <EventSourcingTests.Aggregation.HotelRoomsDefined> event_HotelRoomsDefined104:
                aggregate ??= new EventSourcingTests.Aggregation.RoomsAvailability();
                aggregate.Apply(event_HotelRoomsDefined104.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.Aggregation.RoomBooked> event_RoomBooked105:
                aggregate ??= new EventSourcingTests.Aggregation.RoomsAvailability();
                aggregate.Apply(event_RoomBooked105.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.Aggregation.GuestCheckedOut> event_GuestCheckedOut106:
                aggregate ??= new EventSourcingTests.Aggregation.RoomsAvailability();
                aggregate.Apply(event_GuestCheckedOut106.Data);
                return(aggregate);
            }

            return(aggregate);
        }
Exemplo n.º 3
0
        public override async System.Threading.Tasks.ValueTask <EventSourcingTests.Projections.QuestParty> ApplyEvent(Marten.IQuerySession session, Marten.Events.Projections.EventSlice <EventSourcingTests.Projections.QuestParty, System.Guid> slice, Marten.Events.IEvent evt, EventSourcingTests.Projections.QuestParty aggregate, System.Threading.CancellationToken cancellationToken)
        {
            switch (evt)
            {
            case Marten.Events.IEvent <EventSourcingTests.MembersJoined> event_MembersJoined508:
                aggregate ??= new EventSourcingTests.Projections.QuestParty();
                aggregate.Apply(event_MembersJoined508.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.MembersDeparted> event_MembersDeparted509:
                aggregate ??= new EventSourcingTests.Projections.QuestParty();
                aggregate.Apply(event_MembersDeparted509.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.QuestStarted> event_QuestStarted510:
                aggregate ??= new EventSourcingTests.Projections.QuestParty();
                aggregate.Apply(event_QuestStarted510.Data);
                return(aggregate);
            }

            return(aggregate);
        }
        public override async System.Threading.Tasks.ValueTask <EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection.Identity> ApplyEvent(Marten.IQuerySession session, Marten.Events.Projections.EventSlice <EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection.Identity, System.Guid> slice, Marten.Events.IEvent evt, EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection.Identity aggregate, System.Threading.CancellationToken cancellationToken)
        {
            switch (evt)
            {
            case Marten.Events.IEvent <EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection.UserCreated> event_UserCreated111:
                aggregate ??= new EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection.Identity(event_UserCreated111.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection.IdentityAdded> event_IdentityAdded110:
                if (aggregate == default)
                {
                    throw new ArgumentException("Projection for EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection+Identity should either have the Create Method or Constructor for event of type Marten.Events.IEvent<EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection.IdentityAdded>, or EventSourcingTests.Bugs.Bug_2025_event_inheritance_in_projection+Identity should have a Default Constructor.");
                }
                aggregate.Apply(event_IdentityAdded110.Data);
                return(aggregate);
            }

            return(aggregate);
        }
Exemplo n.º 5
0
        public override async System.Threading.Tasks.ValueTask <EventSourcingTests.Aggregation.Invoice> ApplyEvent(Marten.IQuerySession session, Marten.Events.Projections.EventSlice <EventSourcingTests.Aggregation.Invoice, System.Guid> slice, Marten.Events.IEvent evt, EventSourcingTests.Aggregation.Invoice aggregate, System.Threading.CancellationToken cancellationToken)
        {
            switch (evt)
            {
            case Marten.Events.IEvent <EventSourcingTests.Aggregation.InvoiceInitiated> event_InvoiceInitiated94:
                aggregate ??= new EventSourcingTests.Aggregation.Invoice();
                aggregate.Apply(event_InvoiceInitiated94.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.Aggregation.InvoiceIssued> event_InvoiceIssued95:
                aggregate ??= new EventSourcingTests.Aggregation.Invoice();
                aggregate.Apply(event_InvoiceIssued95.Data);
                return(aggregate);

            case Marten.Events.IEvent <EventSourcingTests.Aggregation.InvoiceSent> event_InvoiceSent96:
                aggregate ??= new EventSourcingTests.Aggregation.Invoice();
                aggregate.Apply(event_InvoiceSent96.Data);
                return(aggregate);
            }

            return(aggregate);
        }