public CreateOrUpdateApplicationRegistryHandler(IDbContext dbContext, ITransitBus transitBus) { _dbContext = dbContext; _transitBus = transitBus; }
public static async Task <bool> InsertOrReplaceOneAsync <T>(this IMongoCollection <T> mongoCollection, ITransitBus transitBus, T command, Expression <Func <T, bool> > predicate) where T : class { bool flag = false; if ((mongoCollection.AsQueryable().Where(predicate).Any())) { await mongoCollection.ReplaceOneAsync(predicate, command); } else { await mongoCollection.InsertOneAsync(command); } if (transitBus != null) { await transitBus.Publish <T>(command); } return(flag); }
public CustomerClient(ITransitBus transitBus) { _transitBus = transitBus; }
public static async Task <bool> InsertOneAsync <T>(this IMongoCollection <T> mongoCollection, ITransitBus transitBus, T command) where T : class { bool flag = false; await mongoCollection.InsertOneAsync(command) .ContinueWith(async(t) => { if (transitBus != null) { await transitBus.Publish <T>(command); } }); flag = true; return(flag); }
public static async Task Publish <T>(this ITransitBus transitBus, T command) where T : class { await transitBus.GetBus.Publish <T>(command).ConfigureAwait(false); }