├── .editorconfig
├── .github
└── workflows
│ ├── build.yml
│ └── release.yml
├── .gitignore
├── Core.Arango.Tests
├── AnalyzerViewTest.cs
├── BackupTest.cs
├── CamelCaseTest.cs
├── CollectionTest.cs
├── Core.Arango.Tests.csproj
├── Core
│ ├── CamelCaseData.cs
│ ├── Entity.cs
│ ├── PascalCaseData.cs
│ └── TestBase.cs
├── DatabaseTest.cs
├── DependencyInjectionTest.cs
├── DocumentTest.cs
├── FoxxTest.cs
├── FunctionTest.cs
├── GraphTest.cs
├── IndexTest.cs
├── LinqTest.cs
├── LinqTest_BasicOperations.cs
├── LinqTest_DateTime.cs
├── LinqTest_String.cs
├── QueryFormattingTest.cs
├── QueryStatisticTest.cs
├── QueryTest.cs
├── Serializer.cs
└── TransactionTest.cs
├── Core.Arango.sln
├── Core.Arango.sln.DotSettings
├── Core.Arango
├── ArangoConfiguration.cs
├── ArangoContext.cs
├── ArangoDB.png
├── ArangoDependencyInjectionExtension.cs
├── ArangoErrorCode.cs
├── ArangoException.cs
├── ArangoHandle.cs
├── ArangoIgnoreAttribute.cs
├── ArangoList.cs
├── Core.Arango.csproj
├── Core.Arango.xml
├── IArangoConfiguration.cs
├── IArangoContext.cs
├── Linq
│ ├── Aql.Array.cs
│ ├── Aql.Date.cs
│ ├── Aql.Geo.cs
│ ├── Aql.Misc.cs
│ ├── Aql.Numeric.cs
│ ├── Aql.String.cs
│ ├── Aql.Type.cs
│ ├── Aql.cs
│ ├── ArangoContextExtension.cs
│ ├── ArangoQueryExtensions.cs
│ ├── ArangoShortestPathExtensions.cs
│ ├── ArangoTraversalExtensions.cs
│ ├── Attributes
│ │ ├── AqlFunctionAttribute.cs
│ │ └── CollectionPropertyAttribute.cs
│ ├── Collection
│ │ └── EdgeDirection.cs
│ ├── Data
│ │ ├── BaseResult.cs
│ │ ├── EdgeVertexResult.cs
│ │ ├── QueryData.cs
│ │ ├── ShortestPathData.cs
│ │ ├── TraversalData.cs
│ │ ├── TraversalEdgeDefinition.cs
│ │ ├── TraversalPathData.cs
│ │ └── TraversalResult.cs
│ ├── Interface
│ │ ├── IAqlModifiable.cs
│ │ ├── IArangoLinq.cs
│ │ ├── ICollectionPropertySetting.cs
│ │ ├── IDocumentPropertySetting.cs
│ │ ├── IShortestPathQueryable.cs
│ │ └── ITraversalQueryable.cs
│ ├── Internal
│ │ └── ArangoLinq.cs
│ ├── Query
│ │ ├── AqlParser.cs
│ │ ├── ArangoExpressionTreeVisitor.cs
│ │ ├── ArangoExpressionTreeVisitorLookups.cs
│ │ ├── ArangoModelVisitor.cs
│ │ ├── ArangoQueryExecuter.cs
│ │ ├── ArangoQueryProvider.cs
│ │ ├── ArangoQueryable.cs
│ │ ├── Clause
│ │ │ ├── FilterClause.cs
│ │ │ ├── FilterExpressionNode.cs
│ │ │ ├── GroupByClause.cs
│ │ │ ├── GroupByExpressionNode.cs
│ │ │ ├── IModificationClause.cs
│ │ │ ├── ITraversalClause.cs
│ │ │ ├── IgnoreModificationSelectExpressionNode.cs
│ │ │ ├── InModificationExpressionNode.cs
│ │ │ ├── InsertClause.cs
│ │ │ ├── InsertExpressionNode.cs
│ │ │ ├── LetClause.cs
│ │ │ ├── LetLambdaExpressionNode.cs
│ │ │ ├── LetSelectExpressionNode.cs
│ │ │ ├── OptionsClause.cs
│ │ │ ├── OptionsExpressionNode.cs
│ │ │ ├── PartialUpdateClause.cs
│ │ │ ├── PartialUpdateExpressionNode.cs
│ │ │ ├── RemoveClause.cs
│ │ │ ├── RemoveExpressionNode.cs
│ │ │ ├── SelectExpressionNode.cs
│ │ │ ├── SelectModificationClause.cs
│ │ │ ├── SelectModificationExpressionNode.cs
│ │ │ ├── ShortestPathExpressionNode.cs
│ │ │ ├── SkipExpressionNode.cs
│ │ │ ├── SkipTakeClause.cs
│ │ │ ├── TakeExpressionNode.cs
│ │ │ ├── TraversalClause.cs
│ │ │ ├── TraversalDepthExpressionNode.cs
│ │ │ ├── TraversalDirectionExpressionNode.cs
│ │ │ ├── TraversalEdgeExpressionNode.cs
│ │ │ ├── TraversalExpressionNode.cs
│ │ │ ├── TraversalGraphNameExpressionNode.cs
│ │ │ ├── TraversalOptionsExpressionNode.cs
│ │ │ ├── UpdateReplaceClause.cs
│ │ │ ├── UpdateReplaceExpressionNode.cs
│ │ │ ├── UpsertClause.cs
│ │ │ └── UpsertExpressionNode.cs
│ │ ├── ExpressionParameterRewriter.cs
│ │ ├── ExtentionIdentifierAttribute.cs
│ │ ├── Grouping.cs
│ │ ├── LinqUtility.cs
│ │ ├── NamedExpression.cs
│ │ └── SupportedMethodSpecifications.cs
│ └── Utility
│ │ ├── ReflectionUtils.cs
│ │ └── Utils.cs
├── Modules
│ ├── IArangoAnalyzerModule.cs
│ ├── IArangoBackupModule.cs
│ ├── IArangoCollectionModule.cs
│ ├── IArangoDatabaseModule.cs
│ ├── IArangoDocumentModule.cs
│ ├── IArangoFoxxModule.cs
│ ├── IArangoFunctionModule.cs
│ ├── IArangoGraphEdgeModule.cs
│ ├── IArangoGraphModule.cs
│ ├── IArangoGraphVertexModule.cs
│ ├── IArangoIndexModule.cs
│ ├── IArangoPregelModule.cs
│ ├── IArangoQueryModule.cs
│ ├── IArangoTransactionModule.cs
│ ├── IArangoUserModule.cs
│ ├── IArangoViewModule.cs
│ └── Internal
│ │ ├── ArangoAnalyzerModule.cs
│ │ ├── ArangoBackupModule.cs
│ │ ├── ArangoCollectionModule.cs
│ │ ├── ArangoDatabaseModule.cs
│ │ ├── ArangoDocumentModule.cs
│ │ ├── ArangoFoxxModule.cs
│ │ ├── ArangoFunctionModule.cs
│ │ ├── ArangoGraphEdgeModule.cs
│ │ ├── ArangoGraphModule.cs
│ │ ├── ArangoGraphVertexModule.cs
│ │ ├── ArangoIndexModule.cs
│ │ ├── ArangoModule.cs
│ │ ├── ArangoPregelModule.cs
│ │ ├── ArangoQueryModule.cs
│ │ ├── ArangoTransactionModule.cs
│ │ ├── ArangoUserModule.cs
│ │ └── ArangoViewModule.cs
├── PolyfillHelper.cs
├── Protocol
│ ├── ArangoAccess.cs
│ ├── ArangoAnalyzer.cs
│ ├── ArangoAnalyzerBreakType.cs
│ ├── ArangoAnalyzerCase.cs
│ ├── ArangoAnalyzerGeoJsonType.cs
│ ├── ArangoAnalyzerProperties.cs
│ ├── ArangoAnalyzerType.cs
│ ├── ArangoAstNode.cs
│ ├── ArangoBackup.cs
│ ├── ArangoBackupRequest.cs
│ ├── ArangoCollection.cs
│ ├── ArangoCollectionType.cs
│ ├── ArangoCollectionUpdate.cs
│ ├── ArangoComputeOn.cs
│ ├── ArangoComputedValue.cs
│ ├── ArangoCursor.cs
│ ├── ArangoDatabase.cs
│ ├── ArangoDatabaseInfo.cs
│ ├── ArangoDatabaseOptions.cs
│ ├── ArangoEdgeDefinition.cs
│ ├── ArangoEdgeNgram.cs
│ ├── ArangoEdgeResponse.cs
│ ├── ArangoError.cs
│ ├── ArangoExplainResult.cs
│ ├── ArangoFoxxService.cs
│ ├── ArangoFoxxSource.cs
│ ├── ArangoFunctionDefinition.cs
│ ├── ArangoGraph.cs
│ ├── ArangoGraphOptions.cs
│ ├── ArangoIndex.cs
│ ├── ArangoIndexType.cs
│ ├── ArangoKeyOptions.cs
│ ├── ArangoKeyType.cs
│ ├── ArangoLinkProperty.cs
│ ├── ArangoNgramStreamType.cs
│ ├── ArangoOverwriteMode.cs
│ ├── ArangoParseResult.cs
│ ├── ArangoPregel.cs
│ ├── ArangoPregelState.cs
│ ├── ArangoQueryOptimizer.cs
│ ├── ArangoQueryOptions.cs
│ ├── ArangoQueryStatistic.cs
│ ├── ArangoResponseBase.cs
│ ├── ArangoSchema.cs
│ ├── ArangoSchemaLevel.cs
│ ├── ArangoSort.cs
│ ├── ArangoTransaction.cs
│ ├── ArangoTransactionScope.cs
│ ├── ArangoUpdateResult.cs
│ ├── ArangoUser.cs
│ ├── ArangoVersion.cs
│ ├── ArangoVertexCollection.cs
│ ├── ArangoVertexResponse.cs
│ ├── ArangoView.cs
│ ├── ArangoViewCompressionType.cs
│ ├── ArangoViewConsolidationPolicy.cs
│ ├── ArangoViewConsolidationType.cs
│ ├── ArangoViewInformation.cs
│ ├── ArangoViewStoredValue.cs
│ ├── ArangoVoid.cs
│ └── Internal
│ │ ├── BackupList.cs
│ │ ├── DocumentCreateResponse.cs
│ │ ├── EndpointEntity.cs
│ │ ├── EndpointResponse.cs
│ │ ├── ErrorResponse.cs
│ │ ├── ExportRequest.cs
│ │ ├── FunctionCreateResponse.cs
│ │ ├── FunctionRemoveResponse.cs
│ │ ├── GraphResponse.cs
│ │ ├── QueryResponse.cs
│ │ ├── QueryResponseBase.cs
│ │ ├── QueryResponseExtra.cs
│ │ ├── SingleResult.cs
│ │ └── TransactionResponse.cs
├── Relinq
│ ├── Clauses
│ │ ├── AdditionalFromClause.cs
│ │ ├── CloneContext.cs
│ │ ├── ExpressionVisitors
│ │ │ ├── AccessorFindingExpressionVisitor.cs
│ │ │ ├── CloningExpressionVisitor.cs
│ │ │ ├── ReferenceReplacingExpressionVisitor.cs
│ │ │ └── ReverseResolvingExpressionVisitor.cs
│ │ ├── Expressions
│ │ │ ├── IPartialEvaluationExceptionExpressionVisitor.cs
│ │ │ ├── IVBSpecificExpressionVisitor.cs
│ │ │ ├── PartialEvaluationExceptionExpression.cs
│ │ │ ├── QuerySourceReferenceExpression.cs
│ │ │ ├── SubQueryExpression.cs
│ │ │ └── VBStringComparisonExpression.cs
│ │ ├── FromClauseBase.cs
│ │ ├── GroupJoinClause.cs
│ │ ├── IBodyClause.cs
│ │ ├── IClause.cs
│ │ ├── IFromClause.cs
│ │ ├── IQuerySource.cs
│ │ ├── JoinClause.cs
│ │ ├── MainFromClause.cs
│ │ ├── OrderByClause.cs
│ │ ├── Ordering.cs
│ │ ├── OrderingDirection.cs
│ │ ├── QuerySourceMapping.cs
│ │ ├── ResultOperatorBase.cs
│ │ ├── ResultOperators
│ │ │ ├── AggregateFromSeedResultOperator.cs
│ │ │ ├── AggregateResultOperator.cs
│ │ │ ├── AllResultOperator.cs
│ │ │ ├── AnyResultOperator.cs
│ │ │ ├── AsQueryableResultOperator.cs
│ │ │ ├── AverageResultOperator.cs
│ │ │ ├── CastResultOperator.cs
│ │ │ ├── ChoiceResultOperatorBase.cs
│ │ │ ├── ConcatResultOperator.cs
│ │ │ ├── ContainsResultOperator.cs
│ │ │ ├── CountResultOperator.cs
│ │ │ ├── DefaultIfEmptyResultOperator.cs
│ │ │ ├── DistinctResultOperator.cs
│ │ │ ├── ExceptResultOperator.cs
│ │ │ ├── FirstResultOperator.cs
│ │ │ ├── GroupResultOperator.cs
│ │ │ ├── IntersectResultOperator.cs
│ │ │ ├── LastResultOperator.cs
│ │ │ ├── LongCountResultOperator.cs
│ │ │ ├── MaxResultOperator.cs
│ │ │ ├── MinResultOperator.cs
│ │ │ ├── OfTypeResultOperator.cs
│ │ │ ├── ReverseResultOperator.cs
│ │ │ ├── SequenceFromSequenceResultOperatorBase.cs
│ │ │ ├── SequenceTypePreservingResultOperatorBase.cs
│ │ │ ├── SingleResultOperator.cs
│ │ │ ├── SkipResultOperator.cs
│ │ │ ├── SumResultOperator.cs
│ │ │ ├── TakeResultOperator.cs
│ │ │ ├── UnionResultOperator.cs
│ │ │ └── ValueFromSequenceResultOperatorBase.cs
│ │ ├── SelectClause.cs
│ │ ├── StreamedData
│ │ │ ├── IStreamedData.cs
│ │ │ ├── IStreamedDataInfo.cs
│ │ │ ├── StreamedScalarValueInfo.cs
│ │ │ ├── StreamedSequence.cs
│ │ │ ├── StreamedSequenceInfo.cs
│ │ │ ├── StreamedSingleValueInfo.cs
│ │ │ ├── StreamedValue.cs
│ │ │ └── StreamedValueInfo.cs
│ │ └── WhereClause.cs
│ ├── Collections
│ │ ├── ChangeResistantObservableCollectionEnumerator.cs
│ │ ├── IndexValuePair.cs
│ │ ├── MultiDictionaryExtensions.cs
│ │ └── ObservableCollectionExtensions.cs
│ ├── DefaultQueryProvider.cs
│ ├── IQueryExecutor.cs
│ ├── IQueryModelVisitor.cs
│ ├── Packages
│ │ ├── ArgumentUtility.cs
│ │ ├── Assertion.cs
│ │ ├── AssertionConditionAttribute.cs
│ │ ├── AssertionConditionType.cs
│ │ ├── AssertionMethodAttribute.cs
│ │ ├── BaseTypeRequiredAttribute.cs
│ │ ├── CanBeNullAttribute.cs
│ │ ├── CannotApplyEqualityOperatorAttribute.cs
│ │ ├── ContractAnnotationAttribute.cs
│ │ ├── ImplicitUseKindFlags.cs
│ │ ├── ImplicitUseTargetFlags.cs
│ │ ├── InstantHandleAttribute.cs
│ │ ├── InvokerParameterNameAttribute.cs
│ │ ├── LinqTunnelAttribute.cs
│ │ ├── LocalizationRequiredAttribute.cs
│ │ ├── MeansImplicitUseAttribute.cs
│ │ ├── NoEnumerationAttribute.cs
│ │ ├── NotNullAttribute.cs
│ │ ├── NotifyPropertyChangedInvocatorAttribute.cs
│ │ ├── NullableTypeUtility.cs
│ │ ├── PathReferenceAttribute.cs
│ │ ├── PublicAPIAttribute.cs
│ │ ├── PureAttribute.cs
│ │ ├── StringFormatMethodAttribute.cs
│ │ ├── TerminatesProgramAttribute.cs
│ │ └── UsedImplicitlyAttribute.cs
│ ├── Parsing
│ │ ├── ExpressionVisitors
│ │ │ ├── MemberBindings
│ │ │ │ ├── FieldInfoBinding.cs
│ │ │ │ ├── MemberBinding.cs
│ │ │ │ ├── MethodInfoBinding.cs
│ │ │ │ └── PropertyInfoBinding.cs
│ │ │ ├── MultiReplacingExpressionVisitor.cs
│ │ │ ├── PartialEvaluatingExpressionVisitor.cs
│ │ │ ├── ReplacingExpressionVisitor.cs
│ │ │ ├── SubQueryFindingExpressionVisitor.cs
│ │ │ ├── Transformation
│ │ │ │ ├── ExpressionTransformation.cs
│ │ │ │ ├── ExpressionTransformerRegistry.cs
│ │ │ │ ├── IExpressionTranformationProvider.cs
│ │ │ │ ├── IExpressionTransformer.cs
│ │ │ │ └── PredefinedTransformations
│ │ │ │ │ ├── AttributeEvaluatingExpressionTransformer.cs
│ │ │ │ │ ├── DictionaryEntryNewExpressionTransformer.cs
│ │ │ │ │ ├── InvocationOfLambdaExpressionTransformer.cs
│ │ │ │ │ ├── KeyValuePairNewExpressionTransformer.cs
│ │ │ │ │ ├── MemberAddingNewExpressionTransformerBase.cs
│ │ │ │ │ ├── MethodCallExpressionTransformerAttribute.cs
│ │ │ │ │ ├── NullableValueTransformer.cs
│ │ │ │ │ ├── TupleNewExpressionTransformer.cs
│ │ │ │ │ ├── VBCompareStringExpressionTransformer.cs
│ │ │ │ │ └── VBInformationIsNothingExpressionTransformer.cs
│ │ │ ├── TransformingExpressionVisitor.cs
│ │ │ ├── TransparentIdentifierRemovingExpressionVisitor.cs
│ │ │ └── TreeEvaluation
│ │ │ │ ├── EvaluatableExpressionFilterBase.cs
│ │ │ │ ├── EvaluatableTreeFindingExpressionVisitor.cs
│ │ │ │ ├── IEvaluatableExpressionFilter.cs
│ │ │ │ ├── NullEvaluatableExpressionFilter.cs
│ │ │ │ └── PartialEvaluationInfo.cs
│ │ ├── ParserException.Obsolete.cs
│ │ ├── RelinqExpressionVisitor.cs
│ │ ├── Structure
│ │ │ ├── ExpressionTreeParser.cs
│ │ │ ├── ExpressionTreeProcessors
│ │ │ │ ├── CompoundExpressionTreeProcessor.cs
│ │ │ │ ├── NullExpressionTreeProcessor.cs
│ │ │ │ ├── PartialEvaluatingExpressionTreeProcessor.cs
│ │ │ │ └── TransformingExpressionTreeProcessor.cs
│ │ │ ├── IExpressionTreeProcessor.cs
│ │ │ ├── INodeTypeProvider.cs
│ │ │ ├── IQueryParser.cs
│ │ │ ├── IntermediateModel
│ │ │ │ ├── AggregateExpressionNode.cs
│ │ │ │ ├── AggregateFromSeedExpressionNode.cs
│ │ │ │ ├── AllExpressionNode.cs
│ │ │ │ ├── AnyExpressionNode.cs
│ │ │ │ ├── AsQueryableExpressionNode.cs
│ │ │ │ ├── AverageExpressionNode.cs
│ │ │ │ ├── CastExpressionNode.cs
│ │ │ │ ├── ClauseGenerationContext.cs
│ │ │ │ ├── ConcatExpressionNode.cs
│ │ │ │ ├── ContainsExpressionNode.cs
│ │ │ │ ├── CountExpressionNode.cs
│ │ │ │ ├── DefaultIfEmptyExpressionNode.cs
│ │ │ │ ├── DistinctExpressionNode.cs
│ │ │ │ ├── ExceptExpressionNode.cs
│ │ │ │ ├── ExpressionNodeInstantiationException.cs
│ │ │ │ ├── ExpressionResolver.cs
│ │ │ │ ├── FirstExpressionNode.cs
│ │ │ │ ├── GroupByExpressionNode.cs
│ │ │ │ ├── GroupByWithResultSelectorExpressionNode.cs
│ │ │ │ ├── GroupJoinExpressionNode.cs
│ │ │ │ ├── IExpressionNode.cs
│ │ │ │ ├── IQuerySourceExpressionNode.cs
│ │ │ │ ├── IntersectExpressionNode.cs
│ │ │ │ ├── JoinExpressionNode.cs
│ │ │ │ ├── LastExpressionNode.cs
│ │ │ │ ├── LongCountExpressionNode.cs
│ │ │ │ ├── MainSourceExpressionNode.cs
│ │ │ │ ├── MaxExpressionNode.cs
│ │ │ │ ├── MethodCallExpressionNodeBase.cs
│ │ │ │ ├── MethodCallExpressionNodeFactory.cs
│ │ │ │ ├── MethodCallExpressionParseInfo.cs
│ │ │ │ ├── MinExpressionNode.cs
│ │ │ │ ├── OfTypeExpressionNode.cs
│ │ │ │ ├── OrderByDescendingExpressionNode.cs
│ │ │ │ ├── OrderByExpressionNode.cs
│ │ │ │ ├── QuerySourceExpressionNodeUtility.cs
│ │ │ │ ├── QuerySourceSetOperationExpressionNodeBase.cs
│ │ │ │ ├── ResolvedExpressionCache.cs
│ │ │ │ ├── ResultOperatorExpressionNodeBase.cs
│ │ │ │ ├── ReverseExpressionNode.cs
│ │ │ │ ├── SelectExpressionNode.cs
│ │ │ │ ├── SelectManyExpressionNode.cs
│ │ │ │ ├── SingleExpressionNode.cs
│ │ │ │ ├── SkipExpressionNode.cs
│ │ │ │ ├── SumExpressionNode.cs
│ │ │ │ ├── SupportedMethodSpecifications.cs
│ │ │ │ ├── TakeExpressionNode.cs
│ │ │ │ ├── ThenByDescendingExpressionNode.cs
│ │ │ │ ├── ThenByExpressionNode.cs
│ │ │ │ ├── UnionExpressionNode.cs
│ │ │ │ └── WhereExpressionNode.cs
│ │ │ ├── MethodCallExpressionParser.cs
│ │ │ ├── NodeTypeProviders
│ │ │ │ ├── CompoundNodeTypeProvider.cs
│ │ │ │ ├── MethodInfoBasedNodeTypeRegistry.cs
│ │ │ │ ├── MethodNameBasedNodeTypeRegistry.cs
│ │ │ │ └── NameBasedRegistrationInfo.cs
│ │ │ └── QueryParser.cs
│ │ ├── ThrowingExpressionVisitor.cs
│ │ └── TupleExpressionBuilder.cs
│ ├── QueryModel.cs
│ ├── QueryModelBuilder.cs
│ ├── QueryModelVisitorBase.cs
│ ├── QueryProviderBase.cs
│ ├── QueryableBase.cs
│ ├── Transformations
│ │ └── SubQueryFromClauseFlattener.cs
│ ├── UniqueIdentifierGenerator.cs
│ └── Utilities
│ │ ├── ExpressionExtensions.cs
│ │ ├── ItemTypeReflectionUtility.cs
│ │ ├── ReflectionExtensions.cs
│ │ ├── ReflectionUtility.cs
│ │ └── StringUtility.cs
├── Serialization
│ ├── IArangoFormattable.cs
│ ├── IArangoSerializer.cs
│ ├── Json
│ │ ├── ArangoJsonCamelCasePolicy.cs
│ │ ├── ArangoJsonDefaultPolicy.cs
│ │ ├── ArangoJsonSerializer.cs
│ │ ├── JsonStringEnumMemberConverter.cs
│ │ └── JsonStringEnumMemberConverterHelper.cs
│ └── Newtonsoft
│ │ ├── ArangoNewtonsoftCamelCaseContractResolver.cs
│ │ ├── ArangoNewtonsoftDefaultContractResolver.cs
│ │ └── ArangoNewtonsoftSerializer.cs
└── Transport
│ ├── ArangoHttpTransport.cs
│ └── IArangoTransport.cs
├── LICENSE
├── NOTICE
├── README.md
└── docker
├── clean_cluster.sh
├── clean_single.sh
├── debug_containers_cluster.sh
├── debug_containers_single.sh
├── server.pem
├── start_db_cluster.sh
├── start_db_cluster_retry_fail.sh
├── start_db_cluster_ssl.sh
├── start_db_single.sh
├── start_db_single_retry_fail.sh
└── start_db_single_ssl.sh
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Remove the line below if you want to inherit .editorconfig settings from higher directories
2 | root = true
3 |
4 | # C# files
5 | [*.cs]
6 |
7 | #### Core EditorConfig Options ####
8 |
9 | # Indentation and spacing
10 | indent_size = 4
11 | indent_style = space
12 | tab_width = 4
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | pull_request:
8 | branches:
9 | - master
10 | workflow_dispatch:
11 |
12 | jobs:
13 | build:
14 | timeout-minutes: 20
15 | runs-on: ubuntu-latest
16 |
17 | strategy:
18 | fail-fast: false
19 | matrix:
20 | dotnet:
21 | - 9.x
22 | arango:
23 | - "arangodb:3.11"
24 | # - "arangodb:3.10"
25 | # - "arangodb/enterprise:3.9"
26 | topology:
27 | - single
28 | # - cluster
29 |
30 | steps:
31 | - uses: actions/checkout@v3
32 |
33 | - name: chmod
34 | run: find ./docker -name '*.sh' | xargs chmod +x
35 |
36 | - name: arango
37 | run: ./docker/start_db_${{ matrix.topology }}_retry_fail.sh ${{ matrix.arango }}
38 | env:
39 | ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }}
40 |
41 | - name: dotnet
42 | uses: actions/setup-dotnet@v3
43 | with:
44 | dotnet-version: ${{ matrix.dotnet }}
45 |
46 | - name: build
47 | run: dotnet build --configuration Release
48 |
49 | - name: test
50 | run: dotnet test --configuration Release
51 | env:
52 | ARANGODB_CONNECTION: "Server=http://172.28.3.1:8529;Realm=CI-{UUID};User=root;Password=test;"
53 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*.*.*'
7 |
8 | jobs:
9 | build:
10 |
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v3
15 |
16 | - name: Setup
17 | uses: actions/setup-dotnet@v3
18 | with:
19 | dotnet-version: 9.x
20 |
21 | - name: Build Version
22 | id: vars
23 | run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
24 |
25 | - name: Apply Version
26 | uses: jacobtomlinson/gha-find-replace@v2
27 | with:
28 | find: ".*<\\/Version>"
29 | replace: "${{ steps.vars.outputs.VERSION }}"
30 | include: "**/Core.Arango.csproj"
31 | regex: true
32 |
33 | - name: Build
34 | run: dotnet build --configuration Release
35 |
36 | - name: Pack
37 | run: dotnet pack --configuration Release
38 |
39 | - name: Publish
40 | run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vs
2 | .idea
3 | bin
4 | obj
5 | *.user
6 | *.suo
--------------------------------------------------------------------------------
/Core.Arango.Tests/BackupTest.cs:
--------------------------------------------------------------------------------
1 | namespace Core.Arango.Tests
2 | {
3 | /*public class BackupTest : TestBase
4 | {
5 | [Fact]
6 | public async Task BackupRestoreDelete()
7 | {
8 | await SetupAsync("system-camel");
9 |
10 | var version = await Arango.GetVersionAsync();
11 |
12 | if (version.License != "enterprise")
13 | return;
14 |
15 | var backup = await Arango.Backup.CreateAsync(new ArangoBackupRequest
16 | {
17 | AllowInconsistent = false,
18 | Force = true,
19 | Label = "test",
20 | Timeout = 30
21 | });
22 |
23 | await Task.Delay(1000);
24 | await Arango.Backup.ListAsync();
25 |
26 | await Arango.Backup.RestoreAsync(backup.Id);
27 |
28 | await Task.Delay(1000);
29 | await Arango.Backup.DeleteAsync(backup.Id);
30 | }
31 | }*/
32 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/CamelCaseTest.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using Core.Arango.Protocol;
4 | using Core.Arango.Tests.Core;
5 | using Xunit;
6 |
7 | namespace Core.Arango.Tests
8 | {
9 | public class CamelCaseTest : TestBase
10 | {
11 | [Theory]
12 | [ClassData(typeof(CamelCaseData))]
13 | public async Task GetCamelCase(string serializer)
14 | {
15 | await SetupAsync(serializer);
16 | await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document);
17 |
18 | await Arango.Document.CreateAsync("test", "test", new
19 | {
20 | Key = "abc",
21 | Name = "a",
22 | SomeName = "b"
23 | });
24 |
25 | var doc = await Arango.Document.GetAsync>("test", "test", "abc");
26 |
27 | Assert.Equal("a", doc["name"]);
28 | Assert.Equal("b", doc["someName"]);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/Core.Arango.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | all
18 | runtime; build; native; contentfiles; analyzers; buildtransitive
19 |
20 |
21 | all
22 | runtime; build; native; contentfiles; analyzers; buildtransitive
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Core.Arango.Tests/Core/CamelCaseData.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | namespace Core.Arango.Tests.Core
4 | {
5 | public class CamelCaseData : TheoryData
6 | {
7 | public CamelCaseData()
8 | {
9 | Add("newton-camel");
10 | Add("system-camel");
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/Core/PascalCaseData.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | namespace Core.Arango.Tests.Core
4 | {
5 | public class PascalCaseData : TheoryData
6 | {
7 | public PascalCaseData()
8 | {
9 | Add("newton-default");
10 | Add("system-default");
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/DatabaseTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Core.Arango.Protocol;
4 | using Core.Arango.Tests.Core;
5 | using Xunit;
6 | using Xunit.Abstractions;
7 |
8 | namespace Core.Arango.Tests
9 | {
10 | public class DatabaseTest : TestBase
11 | {
12 | private readonly ITestOutputHelper _output;
13 |
14 | public DatabaseTest(ITestOutputHelper output)
15 | {
16 | _output = output;
17 | }
18 |
19 | [Theory]
20 | [ClassData(typeof(PascalCaseData))]
21 | public async Task Create(string serializer)
22 | {
23 | await SetupAsync(serializer, null);
24 |
25 | await Arango.Database.CreateAsync("test");
26 | await Arango.Database.CreateAsync(new ArangoDatabase
27 | {
28 | Name = "test2"
29 | });
30 | await Arango.Database.ListAsync();
31 |
32 | Assert.True(await Arango.Database.ExistAsync("test"));
33 | Assert.True(await Arango.Database.ExistAsync("test2"));
34 | Assert.False(await Arango.Database.ExistAsync("test3"));
35 |
36 | var info = await Arango.Database.GetAsync("test");
37 | Assert.EndsWith("-test",info.Name);
38 | }
39 |
40 | [Theory]
41 | [ClassData(typeof(PascalCaseData))]
42 | public async Task Drop(string serializer)
43 | {
44 | await SetupAsync(serializer, null);
45 |
46 | await Arango.Database.CreateAsync("test");
47 | await Arango.Database.DropAsync("test");
48 |
49 | var ex = await Assert.ThrowsAsync(async () =>
50 | {
51 | await Arango.Database.DropAsync("test2");
52 | });
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/DependencyInjectionTest.cs:
--------------------------------------------------------------------------------
1 | using Core.Arango.Tests.Core;
2 | using Microsoft.Extensions.DependencyInjection;
3 | using Xunit;
4 |
5 | namespace Core.Arango.Tests
6 | {
7 | public class DependencyInjectionTest : TestBase
8 | {
9 | [Fact]
10 | public void AddArangoConfigurationCallback()
11 | {
12 | var collection = new ServiceCollection();
13 |
14 | collection.AddArango((sp, config) =>
15 | {
16 | config.ConnectionString = UniqueTestRealm();
17 | config.BatchSize = 1337;
18 | });
19 |
20 | var serviceProvider = collection.BuildServiceProvider();
21 | Arango = serviceProvider.GetRequiredService();
22 |
23 | Arango.GetVersionAsync();
24 |
25 | Assert.Equal(1337, Arango.Configuration.BatchSize);
26 | }
27 |
28 | [Fact]
29 | public void AddArangoConnectionStringCallback()
30 | {
31 | var collection = new ServiceCollection();
32 |
33 | collection.AddArango(sp => UniqueTestRealm());
34 |
35 | var serviceProvider = collection.BuildServiceProvider();
36 | Arango = serviceProvider.GetRequiredService();
37 |
38 | Arango.GetVersionAsync();
39 | }
40 |
41 | [Fact]
42 | public void AddArangoConnectionString()
43 | {
44 | var collection = new ServiceCollection();
45 |
46 | collection.AddArango(UniqueTestRealm());
47 |
48 | var serviceProvider = collection.BuildServiceProvider();
49 | Arango = serviceProvider.GetRequiredService();
50 |
51 | Arango.GetVersionAsync();
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/FoxxTest.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coronabytes/dotnet-arangodb/8dc1b7e34bc9d1abbf8d13e7a31c8b402cf2fee6/Core.Arango.Tests/FoxxTest.cs
--------------------------------------------------------------------------------
/Core.Arango.Tests/IndexTest.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using Core.Arango.Protocol;
4 | using Core.Arango.Tests.Core;
5 | using Xunit;
6 |
7 | namespace Core.Arango.Tests
8 | {
9 | public class IndexTest : TestBase
10 | {
11 | [Theory]
12 | [ClassData(typeof(PascalCaseData))]
13 | public async Task DropAll(string serializer)
14 | {
15 | await SetupAsync(serializer);
16 | await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document);
17 |
18 | await Arango.Index.CreateAsync("test", "test", new ArangoIndex
19 | {
20 | Fields = new List {"test"},
21 | Type = ArangoIndexType.Hash
22 | });
23 |
24 | await Arango.Index.DropAllAsync("test");
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/QueryFormattingTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using Core.Arango.Protocol;
5 | using Core.Arango.Tests.Core;
6 | using Xunit;
7 |
8 | namespace Core.Arango.Tests
9 | {
10 | public class QueryFormattingTest : TestBase
11 | {
12 | [Theory]
13 | [ClassData(typeof(PascalCaseData))]
14 | public async Task GuidFormat(string serializer)
15 | {
16 | await SetupAsync(serializer);
17 | await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document);
18 |
19 | var userKey = Guid.Parse("{867E46A9-3623-4D7B-B33A-9E24F0E7D660}");
20 | var clientKey = Guid.Parse("{8038F24B-AF91-4E7D-BAFE-1D96DF7FD06A}");
21 |
22 | var user = await Arango.Query.SingleOrDefaultAsync("test", "test",
23 | $"x._key == {userKey} && x.ClientKey == {clientKey}");
24 | }
25 |
26 | [Theory]
27 | [ClassData(typeof(PascalCaseData))]
28 | public async Task DateTimeFormat(string serializer)
29 | {
30 | await SetupAsync(serializer);
31 | await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document);
32 |
33 | var date = new DateTime(2020, 12, 4, 9, 58, 25, DateTimeKind.Utc);
34 |
35 | var resultDefault = (await Arango.Query.ExecuteAsync("test", $"LET v = {date} RETURN v"))
36 | .SingleOrDefault();
37 |
38 | Assert.Equal("2020-12-04T09:58:25Z", resultDefault);
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/Core.Arango.Tests/QueryStatisticTest.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using Core.Arango.Protocol;
5 | using Core.Arango.Tests.Core;
6 | using Newtonsoft.Json;
7 | using Xunit;
8 | using Xunit.Abstractions;
9 |
10 | namespace Core.Arango.Tests
11 | {
12 | public class QueryStatisticTest(ITestOutputHelper output) : TestBase
13 | {
14 | public override async Task InitializeAsync()
15 | {
16 | Arango =
17 | new ArangoContext(UniqueTestRealm(),
18 | new ArangoConfiguration
19 | {
20 | QueryProfile = (query, bindVars, stats) =>
21 | {
22 | var boundQuery = query;
23 |
24 | foreach (var p in bindVars.OrderByDescending(x => x.Key.Length))
25 | boundQuery = boundQuery.Replace("@" + p.Key, JsonConvert.SerializeObject(p.Value));
26 |
27 | output.WriteLine(
28 | $"{boundQuery}\n{JsonConvert.SerializeObject(stats, Formatting.Indented)}");
29 | }
30 | });
31 | await Arango.Database.CreateAsync("test");
32 | }
33 |
34 | [Fact]
35 | public async Task QueryStats()
36 | {
37 | await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document);
38 |
39 | await Arango.Document.CreateManyAsync("test", "test", new List
40 | {
41 | new() {Value = 1},
42 | new() {Value = 2},
43 | new() {Value = 3},
44 | new() {Value = 4},
45 | new() {Value = 5}
46 | });
47 |
48 | var select = new List {1, 2, 3};
49 |
50 | var res = await Arango.Query.ExecuteAsync("test",
51 | $"FOR e IN test FILTER e.Value IN {select} LIMIT 2 RETURN e", fullCount: true);
52 |
53 | Assert.Equal(2, res.Count);
54 | Assert.Equal(3, res.FullCount);
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/Core.Arango.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.9.34723.18
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Arango", "Core.Arango\Core.Arango.csproj", "{6B8D05CE-CCB7-4FC4-A85F-EADDEF305999}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Arango.Tests", "Core.Arango.Tests\Core.Arango.Tests.csproj", "{F31E2F80-FFFB-43DA-9C6B-971B854D1E35}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{13D67C1C-3066-4412-A1F6-9C9AD13B7C81}"
11 | ProjectSection(SolutionItems) = preProject
12 | .editorconfig = .editorconfig
13 | EndProjectSection
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Release|Any CPU = Release|Any CPU
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {6B8D05CE-CCB7-4FC4-A85F-EADDEF305999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {6B8D05CE-CCB7-4FC4-A85F-EADDEF305999}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {6B8D05CE-CCB7-4FC4-A85F-EADDEF305999}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 | {6B8D05CE-CCB7-4FC4-A85F-EADDEF305999}.Release|Any CPU.Build.0 = Release|Any CPU
25 | {F31E2F80-FFFB-43DA-9C6B-971B854D1E35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {F31E2F80-FFFB-43DA-9C6B-971B854D1E35}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {F31E2F80-FFFB-43DA-9C6B-971B854D1E35}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {F31E2F80-FFFB-43DA-9C6B-971B854D1E35}.Release|Any CPU.Build.0 = Release|Any CPU
29 | EndGlobalSection
30 | GlobalSection(SolutionProperties) = preSolution
31 | HideSolutionNode = FALSE
32 | EndGlobalSection
33 | GlobalSection(ExtensibilityGlobals) = postSolution
34 | SolutionGuid = {D52A3509-0AEE-4464-81B6-E4E4AA95E7ED}
35 | EndGlobalSection
36 | EndGlobal
37 |
--------------------------------------------------------------------------------
/Core.Arango.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
--------------------------------------------------------------------------------
/Core.Arango/ArangoDB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coronabytes/dotnet-arangodb/8dc1b7e34bc9d1abbf8d13e7a31c8b402cf2fee6/Core.Arango/ArangoDB.png
--------------------------------------------------------------------------------
/Core.Arango/ArangoException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Net;
6 | using Core.Arango.Protocol;
7 |
8 | namespace Core.Arango
9 | {
10 | ///
11 | /// Generic Arango exception
12 | ///
13 | public class ArangoException : Exception
14 | {
15 | ///
16 | ///
17 | public ArangoException(string msg) : base(msg)
18 | {
19 | }
20 |
21 | ///
22 | ///
23 | public ArangoException(string msg, string errorMessage, HttpStatusCode code, ArangoErrorCode errorNumber)
24 | : base(msg)
25 | {
26 | ErrorMessage = errorMessage;
27 | Code = code;
28 | ErrorNumber = errorNumber;
29 | }
30 |
31 | ///
32 | ///
33 | public ArangoException(string msg, IEnumerable errors)
34 | : base(msg)
35 | {
36 | Errors = new ReadOnlyCollection(errors.ToArray());
37 | }
38 |
39 | ///
40 | /// Error message
41 | ///
42 | public string ErrorMessage { get; }
43 |
44 | ///
45 | /// HTTP status code
46 | ///
47 | public HttpStatusCode? Code { get; }
48 |
49 | ///
50 | /// Arango error code
51 | ///
52 | public ArangoErrorCode? ErrorNumber { get; }
53 |
54 | ///
55 | /// Error descriptions
56 | ///
57 | public IReadOnlyList Errors { get; }
58 | }
59 | }
--------------------------------------------------------------------------------
/Core.Arango/ArangoIgnoreAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Core.Arango
4 | {
5 | ///
6 | /// Json.NET Only - Mark properties to be ignored from being written to ArangoDB
7 | ///
8 | [AttributeUsage(AttributeTargets.Property)]
9 | public class ArangoIgnoreAttribute : Attribute
10 | {
11 | }
12 | }
--------------------------------------------------------------------------------
/Core.Arango/ArangoList.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Core.Arango
4 | {
5 | ///
6 | /// Generic List with fullcount extension
7 | ///
8 | public class ArangoList : List
9 | {
10 | ///
11 | /// Actual result count of query ignoring LIMIT clause
12 | ///
13 | public long? FullCount { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Aql.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using Core.Arango.Linq.Attributes;
4 |
5 | namespace Core.Arango.Linq
6 | {
7 | ///
8 | /// Built-on AQL functions
9 | ///
10 | [SuppressMessage("CodeQuality", "IDE0060")]
11 | public partial class Aql
12 | {
13 | private static Exception E => new NotImplementedException();
14 |
15 | ///
16 | /// Force return type (not an actual function)
17 | ///
18 | public static T As(object v)
19 | {
20 | throw E;
21 | }
22 |
23 | ///
24 | /// Access to new document version
25 | ///
26 | [AqlFunction("NEW", true)]
27 | public static T New()
28 | {
29 | throw E;
30 | }
31 |
32 | ///
33 | /// Access to old document version
34 | ///
35 | [AqlFunction("OLD", true)]
36 | public static T Old()
37 | {
38 | throw E;
39 | }
40 |
41 | ///
42 | /// Calculate the FNV-1A 64 bit hash for text and return it in a hexadecimal string representation.
43 | ///
44 | [AqlFunction("FNV64")]
45 | public static string Fnv64(object value)
46 | {
47 | throw E;
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/ArangoContextExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using Core.Arango.Linq.Query;
4 |
5 | namespace Core.Arango.Linq
6 | {
7 | ///
8 | /// LINQ Extensions
9 | ///
10 | public static class ArangoContextExtension
11 | {
12 | ///
13 | /// LINQ in sub-expression
14 | ///
15 | public static IQueryable Query(this IArangoContext context)
16 | {
17 | var queryParser = new AqlParser(new ArangoLinq(context, null));
18 | return queryParser.CreateQueryable();
19 | }
20 |
21 | ///
22 | /// LINQ on database
23 | ///
24 | public static IQueryable Query(this IArangoContext context, ArangoHandle handle)
25 | {
26 | var queryParser = new AqlParser(new ArangoLinq(context, handle));
27 | return queryParser.CreateQueryable();
28 | }
29 |
30 | ///
31 | /// LINQ in sub-expression
32 | ///
33 | public static IQueryable Query(this IArangoContext context)
34 | {
35 | var queryParser = new AqlParser(new ArangoLinq(context, null));
36 | return queryParser.CreateQueryable();
37 | }
38 |
39 | ///
40 | /// LINQ on database
41 | ///
42 | public static IQueryable Query(this IArangoContext context, ArangoHandle handle)
43 | {
44 | var queryParser = new AqlParser(new ArangoLinq(context, handle));
45 | return queryParser.CreateQueryable();
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Attributes/AqlFunctionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Core.Arango.Linq.Attributes
4 | {
5 | ///
6 | /// LINQ Arango Function
7 | ///
8 | [AttributeUsage(AttributeTargets.Method)]
9 | public class AqlFunctionAttribute : Attribute
10 | {
11 | ///
12 | ///
13 | ///
14 | public AqlFunctionAttribute(string name)
15 | {
16 | Name = name;
17 | }
18 |
19 | ///
20 | ///
21 | ///
22 | public AqlFunctionAttribute(string name, bool isProperty)
23 | {
24 | Name = name;
25 | IsProperty = isProperty;
26 | }
27 |
28 | ///
29 | ///
30 | ///
31 | public string Name { get; }
32 |
33 | ///
34 | ///
35 | ///
36 | public bool IsProperty { get; }
37 | }
38 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Attributes/CollectionPropertyAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Core.Arango.Linq.Interface;
3 |
4 | namespace Core.Arango.Linq.Attributes
5 | {
6 | [AttributeUsage(AttributeTargets.Class)]
7 | public class CollectionPropertyAttribute : Attribute, ICollectionPropertySetting
8 | {
9 | public string CollectionName { get; set; }
10 |
11 | public NamingConvention Naming { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Collection/EdgeDirection.cs:
--------------------------------------------------------------------------------
1 | namespace Core.Arango.Linq.Collection
2 | {
3 | public enum EdgeDirection
4 | {
5 | Any = 0,
6 | Inbound = 1,
7 | Outbound = 2
8 | }
9 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Data/BaseResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Newtonsoft.Json;
3 |
4 | namespace Core.Arango.Linq.Data
5 | {
6 | public class BaseResult
7 | {
8 | public int? Code { get; set; }
9 |
10 | public bool? Error { get; set; }
11 |
12 | public string ErrorMessage { get; set; }
13 |
14 | public int? ErrorNum { get; set; }
15 |
16 | public bool HasError()
17 | {
18 | return Error == true;
19 | }
20 |
21 | protected void SetProperties(BaseResult baseResult)
22 | {
23 | Code = baseResult.Code;
24 | Error = baseResult.Error;
25 | ErrorMessage = baseResult.ErrorMessage;
26 | ErrorNum = baseResult.ErrorNum;
27 | }
28 |
29 | internal virtual void SetFromJsonTextReader(string name, JsonToken token, object value)
30 | {
31 | if (name == "code" && token == JsonToken.Integer)
32 | Code = Convert.ToInt32(value);
33 |
34 | if (name == "error" && token == JsonToken.Boolean)
35 | Error = Convert.ToBoolean(value);
36 |
37 | if (name == "errorMessage" && token == JsonToken.String)
38 | ErrorMessage = value.ToString();
39 |
40 | if (name == "errorNum" && token == JsonToken.Integer)
41 | ErrorNum = Convert.ToInt32(value);
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Data/EdgeVertexResult.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Core.Arango.Linq.Attributes;
3 | using Core.Arango.Linq.Interface;
4 |
5 | namespace Core.Arango.Linq.Data
6 | {
7 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
8 | public class EdgeVertexResult
9 | {
10 | public TEdge Edge { get; set; }
11 |
12 | public TVertex Vertex { get; set; }
13 | }
14 |
15 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
16 | public class AQLTraversalResult
17 | {
18 | public TVertex Vertex { get; set; }
19 |
20 | public TraversalVisitedPathResult Path { get; set; }
21 | }
22 |
23 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
24 | public class ShortestPathResult
25 | {
26 | public List Vertices { get; set; }
27 |
28 | public List Edges { get; set; }
29 |
30 | public int Distance { get; set; }
31 | }
32 |
33 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
34 | public class PathResult
35 | {
36 | public List Vertices { get; set; }
37 |
38 | public List Edges { get; set; }
39 |
40 | public TVertex Source { get; set; }
41 |
42 | public TVertex Destination { get; set; }
43 | }
44 |
45 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
46 | public class GraphCommonNeighborsResult
47 | {
48 | public string Left { get; set; }
49 |
50 | public string Right { get; set; }
51 |
52 | public List Neighbors { get; set; }
53 | }
54 |
55 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
56 | public class GraphDistanceToResult
57 | {
58 | public string StartVertex { get; set; }
59 |
60 | public string Vertex { get; set; }
61 |
62 | public int Distance { get; set; }
63 | }
64 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Data/ShortestPathData.cs:
--------------------------------------------------------------------------------
1 | using Core.Arango.Linq.Attributes;
2 | using Core.Arango.Linq.Interface;
3 |
4 | namespace Core.Arango.Linq.Data
5 | {
6 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
7 | public class ShortestPathData
8 | {
9 | public TVertex Vertex { get; set; }
10 |
11 | public TEdge Edge { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Data/TraversalData.cs:
--------------------------------------------------------------------------------
1 | using Core.Arango.Linq.Attributes;
2 | using Core.Arango.Linq.Interface;
3 |
4 | namespace Core.Arango.Linq.Data
5 | {
6 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
7 | public class TraversalData
8 | {
9 | public TVertex Vertex { get; set; }
10 |
11 | public TEdge Edge { get; set; }
12 |
13 | public TraversalPathData Path { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Data/TraversalEdgeDefinition.cs:
--------------------------------------------------------------------------------
1 | using Core.Arango.Linq.Collection;
2 |
3 | namespace Core.Arango.Linq.Data
4 | {
5 | public class TraversalEdgeDefinition
6 | {
7 | public string CollectionName { get; set; }
8 |
9 | public EdgeDirection? Direction { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Data/TraversalPathData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Core.Arango.Linq.Attributes;
3 | using Core.Arango.Linq.Interface;
4 |
5 | namespace Core.Arango.Linq.Data
6 | {
7 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
8 | public class TraversalPathData
9 | {
10 | public IList Vertices { get; set; }
11 |
12 | public IList Edges { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Data/TraversalResult.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Core.Arango.Linq.Attributes;
3 | using Core.Arango.Linq.Interface;
4 |
5 | namespace Core.Arango.Linq.Data
6 | {
7 | public class TraversalContainerResult : BaseResult
8 | {
9 | public TraversalResult Result { get; set; }
10 | }
11 |
12 | public class TraversalResult : BaseResult
13 | {
14 | public TraversalVisitedResult Visited { get; set; }
15 | }
16 |
17 | public class TraversalVisitedResult
18 | {
19 | public List Vertices { get; set; }
20 |
21 | public List> Paths { get; set; }
22 | }
23 |
24 | [CollectionProperty(Naming = NamingConvention.ToCamelCase)]
25 | public class TraversalVisitedPathResult
26 | {
27 | public List Vertices { get; set; }
28 |
29 | public List Edges { get; set; }
30 | }
31 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Interface/IAqlModifiable.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 |
3 | namespace Core.Arango.Linq.Interface
4 | {
5 | public interface IAqlModifiable : IQueryable, IOrderedQueryable
6 | {
7 | }
8 |
9 | public interface IAqlModifiable : IAqlModifiable, IQueryable, IOrderedQueryable
10 | {
11 | }
12 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Interface/IArangoLinq.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace Core.Arango.Linq.Interface
7 | {
8 | internal interface IArangoLinq
9 | {
10 | public Func TranslateGroupByIntoName { get; }
11 | public string ResolvePropertyName(Type t, string s);
12 | public string ResolveCollectionName(Type t);
13 | public IAsyncEnumerable StreamAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default);
14 | public ValueTask> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default);
15 | }
16 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Interface/ICollectionPropertySetting.cs:
--------------------------------------------------------------------------------
1 | namespace Core.Arango.Linq.Interface
2 | {
3 | public interface ICollectionPropertySetting
4 | {
5 | string CollectionName { get; set; }
6 |
7 | NamingConvention Naming { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Interface/IDocumentPropertySetting.cs:
--------------------------------------------------------------------------------
1 | namespace Core.Arango.Linq.Interface
2 | {
3 | public enum NamingConvention
4 | {
5 | UnChanged = 0,
6 | ToCamelCase = 1
7 | }
8 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Interface/IShortestPathQueryable.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 |
3 | namespace Core.Arango.Linq.Interface
4 | {
5 | public interface IShortestPathQueryable : IOrderedQueryable
6 | {
7 | }
8 |
9 | public interface IShortestPathQueryable : IShortestPathQueryable, IOrderedQueryable
10 | {
11 | }
12 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Interface/ITraversalQueryable.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 |
3 | namespace Core.Arango.Linq.Interface
4 | {
5 | public interface ITraversalQueryable : IOrderedQueryable
6 | {
7 | }
8 |
9 | public interface ITraversalQueryable : ITraversalQueryable, IOrderedQueryable
10 | {
11 | }
12 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Internal/ArangoLinq.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 | using Core.Arango.Linq.Interface;
6 |
7 | namespace Core.Arango.Linq
8 | {
9 | internal class ArangoLinq : IArangoLinq
10 | {
11 | private readonly IArangoContext _context;
12 | private readonly ArangoHandle _handle;
13 |
14 | public ArangoLinq(IArangoContext context, ArangoHandle handle)
15 | {
16 | _context = context;
17 | _handle = handle;
18 | }
19 |
20 | public string ResolvePropertyName(Type t, string s)
21 | {
22 | return _context.Configuration.ResolveProperty(t, s);
23 | }
24 |
25 | public string ResolveCollectionName(Type t)
26 | {
27 | return _context.Configuration.ResolveCollection(t);
28 | }
29 |
30 | public Func TranslateGroupByIntoName => _context.Configuration.ResolveGroupBy;
31 |
32 | public IAsyncEnumerable StreamAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default)
33 | {
34 | return _context.Query.ExecuteStreamAsync(_handle, query, bindVars, cancellationToken: cancellationToken);
35 | }
36 |
37 | public async ValueTask> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default)
38 | {
39 | return await _context.Query.ExecuteAsync(_handle, query, bindVars, cancellationToken: cancellationToken).ConfigureAwait(false);
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Query/ArangoQueryExecuter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Core.Arango.Linq.Interface;
4 | using Core.Arango.Relinq;
5 |
6 | namespace Core.Arango.Linq.Query
7 | {
8 | internal class ArangoQueryExecuter : IQueryExecutor
9 | {
10 | private readonly IArangoLinq db;
11 |
12 | public ArangoQueryExecuter(IArangoLinq db)
13 | {
14 | this.db = db;
15 | }
16 |
17 | public T ExecuteScalar(QueryModel queryModel)
18 | {
19 | return ExecuteCollection(queryModel).Single();
20 | }
21 |
22 | public T ExecuteSingle(QueryModel queryModel, bool returnDefaultWhenEmpty)
23 | {
24 | return returnDefaultWhenEmpty
25 | ? ExecuteCollection(queryModel).SingleOrDefault()
26 | : ExecuteCollection(queryModel).Single();
27 | }
28 |
29 | public IEnumerable ExecuteCollection(QueryModel queryModel)
30 | {
31 | var visitor = new ArangoModelVisitor(db);
32 | visitor.VisitQueryModel(queryModel);
33 | visitor.QueryData.Query = visitor.QueryText.ToString();
34 |
35 | return db.ExecuteAsync(visitor.QueryData.Query, visitor.QueryData.BindVars).Result.AsEnumerable();
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Query/Clause/FilterClause.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 | using Core.Arango.Relinq;
4 | using Core.Arango.Relinq.Clauses;
5 |
6 | namespace Core.Arango.Linq.Query.Clause
7 | {
8 | internal sealed class FilterClause : IBodyClause
9 | {
10 | private Expression _predicate;
11 |
12 | public FilterClause(Expression predicate)
13 | {
14 | LinqUtility.CheckNotNull("predicate", predicate);
15 | _predicate = predicate;
16 | }
17 |
18 | public Expression Predicate
19 | {
20 | get => _predicate;
21 | set => _predicate = LinqUtility.CheckNotNull("value", value);
22 | }
23 |
24 | public void Accept(IQueryModelVisitor visitor, QueryModel queryModel, int index)
25 | {
26 | LinqUtility.CheckNotNull("visitor", visitor);
27 | LinqUtility.CheckNotNull("queryModel", queryModel);
28 |
29 | var visotor = visitor as ArangoModelVisitor;
30 |
31 | if (visotor == null)
32 | throw new Exception("QueryModelVisitor should be type of ArangoModelVisitor");
33 |
34 | visotor.VisitFilterClause(this, queryModel, index);
35 | }
36 |
37 | public void TransformExpressions(Func transformation)
38 | {
39 | LinqUtility.CheckNotNull("transformation", transformation);
40 | Predicate = transformation(Predicate);
41 | }
42 |
43 | IBodyClause IBodyClause.Clone(CloneContext cloneContext)
44 | {
45 | return Clone(cloneContext);
46 | }
47 |
48 | public FilterClause Clone(CloneContext cloneContext)
49 | {
50 | LinqUtility.CheckNotNull("cloneContext", cloneContext);
51 |
52 | var clone = new FilterClause(Predicate);
53 | return clone;
54 | }
55 |
56 | public override string ToString()
57 | {
58 | return "filter " + Predicate;
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Query/Clause/IModificationClause.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Core.Arango.Linq.Query.Clause
4 | {
5 | internal interface IModificationClause
6 | {
7 | string ItemName { get; set; }
8 |
9 | Type CollectionType { get; set; }
10 |
11 | bool IgnoreSelect { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Query/Clause/ITraversalClause.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq.Expressions;
3 | using Core.Arango.Linq.Data;
4 |
5 | namespace Core.Arango.Linq.Query.Clause
6 | {
7 | internal interface ITraversalClause
8 | {
9 | string GraphName { get; set; }
10 |
11 | List EdgeCollections { get; set; }
12 |
13 | string Identifier { get; set; }
14 |
15 | ConstantExpression Options { get; set; }
16 |
17 | ConstantExpression Min { get; set; }
18 |
19 | ConstantExpression Max { get; set; }
20 |
21 | ConstantExpression Direction { get; set; }
22 |
23 | Expression StartVertex { get; set; }
24 |
25 | Expression TargetVertex { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/Core.Arango/Linq/Query/Clause/IgnoreModificationSelectExpressionNode.cs:
--------------------------------------------------------------------------------
1 | using System.Linq.Expressions;
2 | using System.Reflection;
3 | using Core.Arango.Relinq;
4 | using Core.Arango.Relinq.Parsing.Structure.IntermediateModel;
5 |
6 | namespace Core.Arango.Linq.Query.Clause
7 | {
8 | internal class IgnoreModificationSelectExpressionNode : MethodCallExpressionNodeBase
9 | {
10 | public static readonly MethodInfo[] SupportedMethods =
11 | {
12 | LinqUtility.GetSupportedMethod(() => ArangoQueryableExtensions.IgnoreModificationSelect