Example #1
0
 public Task On(UpdateEvent e)
 {
     return(_collection.FindAndModifyAsync(e, x => x.Id == e.AggregateId.AsString(), m =>
     {
         m.Text = e.Text;
     }));
 }
        public static Task FindAndModifyAsync <TModel, TKey>(
            this ICollectionWrapper <TModel, TKey> collectionWrapper,
            DomainEvent e,
            TKey id,
            Action <TModel> action,
            bool notify = false)
            where TModel : IReadModelEx <TKey>
        {
            Func <TModel, Task> wrapper = m =>
            {
                action(m);
                return(Task.CompletedTask);
            };

            return(collectionWrapper.FindAndModifyAsync(e, id, wrapper, notify));
        }