public static Task <TModel> UpsertAsync <TModel, TKey>( this ICollectionWrapper <TModel, TKey> collectionWrapper, DomainEvent e, TKey id, Func <TModel> insert, Action <TModel> update, bool notify = false) where TModel : IReadModelEx <TKey> { Func <TModel, Task> wrapper = m => { update(m); return(Task.CompletedTask); }; return(collectionWrapper.UpsertAsync(e, id, insert, wrapper, notify)); }