public virtual async Task <IdInStoreValidationResult> ValidateIds(IExcelRowParseResult parseResult, IExcelRowParseRequest request) { var result = new IdInStoreValidationResult(); if (!parseResult.InvalidIdValue.Value) { var found = await repo.RowRecordExists(request.Row.Sheet, parseResult.UserDefinedId.Value); if (found.HasValue) { result.IdDuplicate = true; } } if (parseResult.ForeignUserDefinedId.HasValue) { var found = await repo.RowRecordExists(request.Row.Sheet.Parent.Sheets.FirstOrDefault(x => x.Index == 0) , parseResult.ForeignUserDefinedId.Value); if (!found.HasValue) { result.ForeignIdNotFound = true; } else { result.ForeignId = found.Value; } } return(result); }
public void Populate(IdInStoreValidationResult result) { IdDuplicate = result.IdDuplicate; ForeignIdNotFound = result.ForeignIdNotFound; ForeignId = result.ForeignId; }