public async Task <OperationResult> Upsert <TEntity, TCriteria>(TCriteria commandCriteria) where TEntity : class, IEntity where TCriteria : CommandCriteria { var command = _commands.FirstOrDefault(x => x.CommandType == commandCriteria.CommandType) as ElasticCommandObject <TEntity, TCriteria>; if (command == null) { throw new NotImplementedException(); } return(await _elasticRepository.PutOneAsync(command, commandCriteria)); }