Example #1
0
        public EventCustomerAggregate GetRegisteredEvent(long customerId, long eventId)
        {
            var customerEventBasicInfoTypedView = new CustomerEventBasicInfoTypedView();
            var bucket = new RelationPredicateBucket(CustomerEventBasicInfoFields.EventId == eventId);

            bucket.PredicateExpression.AddWithAnd(CustomerEventBasicInfoFields.CustomerId == customerId);
            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                myAdapter.FetchTypedView(customerEventBasicInfoTypedView, bucket, false);
            }
            return(_factory.CreateAggregatesFromTypedViewCollection(customerEventBasicInfoTypedView).FirstOrDefault());
        }
Example #2
0
 public void CreateAggregatesFromTypedViewCollectionThrowsExceptionWhenNullTypedViewGiven()
 {
     _eventCustomerAggregateFactory.CreateAggregatesFromTypedViewCollection(null);
 }