Exemple #1
0
        public async Task <object> FindExistedRecordOrDefaultAsync(ImportingJob importingTask, IReadOnlyDictionary <string, object> symbols)
        {
            var entityWhere = importingTask.Descriptor.ImportEntity.Where;

            if (string.IsNullOrEmpty(entityWhere))
            {
                return(null);
            }
            var pred = this.CreateEntityPredicateExpression(entityWhere, symbols);
            var repo = importingTask.Descriptor.IsSudo ? _repository.Sudo() : _repository;

            return(await _repository.FirstOrDefaultAsync(pred));
        }
Exemple #2
0
 public async Task InsertOrUpdateEntityAsync(ImportingJob importingTask, object record, bool canUpdate)
 {
     var typedRecord = (TEntity)record;
     var repo        = importingTask.Descriptor.IsSudo ? _repository.Sudo() : _repository;
     await repo.InsertOrUpdateAsync(typedRecord);
 }