Example #1
0
 public CreateOrUpdateApplicationRegistryHandler(IDbContext dbContext, ITransitBus transitBus)
 {
     _dbContext  = dbContext;
     _transitBus = transitBus;
 }
Example #2
0
        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;
 }
Example #4
0
        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);
        }
Example #5
0
 public static async Task Publish <T>(this ITransitBus transitBus, T command) where T : class
 {
     await transitBus.GetBus.Publish <T>(command).ConfigureAwait(false);
 }