private async Task PersistIdempotenceAsync(EventStoreContext container) { try { var IdempotenceWriterService = container.Container.ResolveOptional <IIdempotenceWriterService>(); if (IdempotenceWriterService == null) { return; } var eventStoreIdempotence = new EventStoreIdempotence() { Id = container.ResolvedEvent.Event.EventId, CreatedOn = DateTime.UtcNow, }; await IdempotenceWriterService.PersistIdempotenceAsync(eventStoreIdempotence); } catch (Exception e) { Console.WriteLine(e); } }
public async Task PersistIdempotenceAsync(EventStoreIdempotence entity) { await _dbContext.EventStoreIdempotences.AddAsync(entity); await _dbContext.SaveChangesAsync(); }
public async Task PersistIdempotenceAsync(EventStoreIdempotence entity) { await _mongoConfiguration.GetIdempotenceCollection.InsertOneAsync(entity); }