diff --git a/Core.Arango.Tests/AnalyzerViewTest.cs b/Core.Arango.Tests/AnalyzerViewTest.cs index 0cd53040fc..f956618497 100644 --- a/Core.Arango.Tests/AnalyzerViewTest.cs +++ b/Core.Arango.Tests/AnalyzerViewTest.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Threading.Tasks; using Core.Arango.Protocol; using Core.Arango.Tests.Core; +using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace Core.Arango.Tests @@ -26,7 +26,7 @@ public async Task AnalyzersViews(string serializer) Stopwords = new List(), Stemming = false }, - Features = new List {"position", "norm", "frequency"} + Features = new List { "position", "norm", "frequency" } }); await Arango.Collection.CreateAsync("test", "collection", ArangoCollectionType.Document); @@ -42,7 +42,7 @@ public async Task AnalyzersViews(string serializer) { ["Name"] = new() { - Analyzers = new List {"text_de_nostem"} + Analyzers = new List { "text_de_nostem" } } } } diff --git a/Core.Arango.Tests/CamelCaseTest.cs b/Core.Arango.Tests/CamelCaseTest.cs index 84d46470ca..e59f3c343d 100644 --- a/Core.Arango.Tests/CamelCaseTest.cs +++ b/Core.Arango.Tests/CamelCaseTest.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Threading.Tasks; using Core.Arango.Protocol; using Core.Arango.Tests.Core; +using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace Core.Arango.Tests diff --git a/Core.Arango.Tests/CollectionTest.cs b/Core.Arango.Tests/CollectionTest.cs index 862f23f395..d0e1972f84 100644 --- a/Core.Arango.Tests/CollectionTest.cs +++ b/Core.Arango.Tests/CollectionTest.cs @@ -1,7 +1,7 @@ -using System; -using System.Threading.Tasks; using Core.Arango.Protocol; using Core.Arango.Tests.Core; +using System; +using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; @@ -80,9 +80,9 @@ public async Task Schema(string serializer) type = "object", properties = new { - name = new {type = "string"} + name = new { type = "string" } }, - required = new[] {"name"} + required = new[] { "name" } //additionalProperties = true } } diff --git a/Core.Arango.Tests/Core.Arango.Tests.csproj b/Core.Arango.Tests/Core.Arango.Tests.csproj index 7dc0ea74e9..c3bc2ffcf8 100644 --- a/Core.Arango.Tests/Core.Arango.Tests.csproj +++ b/Core.Arango.Tests/Core.Arango.Tests.csproj @@ -10,21 +10,22 @@ - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Core.Arango.Tests/Core/Entity.cs b/Core.Arango.Tests/Core/Entity.cs index c1873c8b82..194c958fed 100644 --- a/Core.Arango.Tests/Core/Entity.cs +++ b/Core.Arango.Tests/Core/Entity.cs @@ -1,7 +1,7 @@ +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Tests.Core { diff --git a/Core.Arango.Tests/Core/TestBase.cs b/Core.Arango.Tests/Core/TestBase.cs index db9ee489f8..744c6bd743 100644 --- a/Core.Arango.Tests/Core/TestBase.cs +++ b/Core.Arango.Tests/Core/TestBase.cs @@ -1,10 +1,10 @@ -using System; -using System.Linq; -using System.Threading.Tasks; using Core.Arango.Linq; using Core.Arango.Serialization.Json; using Core.Arango.Serialization.Newtonsoft; using Newtonsoft.Json; +using System; +using System.Linq; +using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; @@ -14,10 +14,7 @@ public abstract class TestBase : IAsyncLifetime { public IArangoContext Arango { get; protected set; } - public virtual Task InitializeAsync() - { - return Task.CompletedTask; - } + public virtual Task InitializeAsync() => Task.CompletedTask; public async Task DisposeAsync() { diff --git a/Core.Arango.Tests/DatabaseTest.cs b/Core.Arango.Tests/DatabaseTest.cs index 5f54097318..6a46dede37 100644 --- a/Core.Arango.Tests/DatabaseTest.cs +++ b/Core.Arango.Tests/DatabaseTest.cs @@ -1,7 +1,6 @@ -using System; -using System.Threading.Tasks; using Core.Arango.Protocol; using Core.Arango.Tests.Core; +using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; @@ -34,7 +33,7 @@ await Arango.Database.CreateAsync(new ArangoDatabase Assert.False(await Arango.Database.ExistAsync("test3")); var info = await Arango.Database.GetAsync("test"); - Assert.EndsWith("-test",info.Name); + Assert.EndsWith("-test", info.Name); } [Theory] diff --git a/Core.Arango.Tests/DocumentTest.cs b/Core.Arango.Tests/DocumentTest.cs index d53513bf9f..829b70840c 100644 --- a/Core.Arango.Tests/DocumentTest.cs +++ b/Core.Arango.Tests/DocumentTest.cs @@ -1,9 +1,9 @@ +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; using System; using System.Collections.Generic; using System.Net; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Tests.Core; using Xunit; namespace Core.Arango.Tests @@ -165,7 +165,7 @@ public async Task CreateSilent(string serializer) await Arango.Collection.CreateAsync("test", "test", ArangoCollectionType.Document); - await Arango.Document.CreateAsync("test", "test", new + await Arango.Document.CreateAsync("test", "test", new { Key = "abc", Name = "a" diff --git a/Core.Arango.Tests/FoxxTest.cs b/Core.Arango.Tests/FoxxTest.cs index 3b8fd1c2f3..0e78544f58 100644 --- a/Core.Arango.Tests/FoxxTest.cs +++ b/Core.Arango.Tests/FoxxTest.cs @@ -1,11 +1,11 @@ +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Linq; using System.Text; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Tests.Core; using Xunit; namespace Core.Arango.Tests diff --git a/Core.Arango.Tests/FunctionTest.cs b/Core.Arango.Tests/FunctionTest.cs index d98bf0dc8a..fd79589f27 100644 --- a/Core.Arango.Tests/FunctionTest.cs +++ b/Core.Arango.Tests/FunctionTest.cs @@ -1,9 +1,9 @@ +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Tests.Core; using Xunit; namespace Core.Arango.Tests @@ -181,7 +181,7 @@ private void AssertFunctionsList(IList expectedNames, Assert.Equal(expectedNames.Count, list.Count); - foreach (var example in expectedNames.Select(name => new ArangoFunctionDefinition {Name = name})) + foreach (var example in expectedNames.Select(name => new ArangoFunctionDefinition { Name = name })) Assert.Contains(example, list, _functionsComparer); } diff --git a/Core.Arango.Tests/GraphTest.cs b/Core.Arango.Tests/GraphTest.cs index ea0a6189bb..40b2ac0157 100644 --- a/Core.Arango.Tests/GraphTest.cs +++ b/Core.Arango.Tests/GraphTest.cs @@ -130,7 +130,7 @@ public async Task TransactionalOperations(string serializer) var transaction0 = await Arango.Transaction.BeginAsync("test", new ArangoTransaction() - { Collections = new ArangoTransactionScope { Write = [ "vertices", "edges" ] }}); + { Collections = new ArangoTransactionScope { Write = ["vertices", "edges"] } }); await Arango.Graph.Vertex.CreateAsync(transaction0, "graph", "vertices", new { @@ -166,7 +166,7 @@ public async Task TransactionalOperations(string serializer) var transaction1 = await Arango.Transaction.BeginAsync("test", new ArangoTransaction() - { Collections = new ArangoTransactionScope { Write = ["vertices", "edges" ] } }); + { Collections = new ArangoTransactionScope { Write = ["vertices", "edges"] } }); await Arango.Graph.Edge.CreateAsync(transaction1, "graph", "edges", new { @@ -178,7 +178,7 @@ public async Task TransactionalOperations(string serializer) var transaction2 = await Arango.Transaction.BeginAsync("test", new ArangoTransaction() - { Collections = new ArangoTransactionScope { Write = [ "vertices", "edges" ] } }); + { Collections = new ArangoTransactionScope { Write = ["vertices", "edges"] } }); await Arango.Graph.Edge.CreateAsync(transaction2, "graph", "edges", new { diff --git a/Core.Arango.Tests/IndexTest.cs b/Core.Arango.Tests/IndexTest.cs index b77a83e136..f1e5b9b7c7 100644 --- a/Core.Arango.Tests/IndexTest.cs +++ b/Core.Arango.Tests/IndexTest.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Threading.Tasks; using Core.Arango.Protocol; using Core.Arango.Tests.Core; +using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace Core.Arango.Tests @@ -17,7 +17,7 @@ public async Task DropAll(string serializer) await Arango.Index.CreateAsync("test", "test", new ArangoIndex { - Fields = new List {"test"}, + Fields = new List { "test" }, Type = ArangoIndexType.Hash }); diff --git a/Core.Arango.Tests/LinqTest.cs b/Core.Arango.Tests/LinqTest.cs index 2e7fa9ccee..f0c7a3000b 100644 --- a/Core.Arango.Tests/LinqTest.cs +++ b/Core.Arango.Tests/LinqTest.cs @@ -1,16 +1,13 @@ +using Core.Arango.Linq; +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; +using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; using System.Linq; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Linq; -using Core.Arango.Tests.Core; -using Newtonsoft.Json; using Xunit; using Xunit.Abstractions; -using System.Linq.Expressions; namespace Core.Arango.Tests { diff --git a/Core.Arango.Tests/LinqTest_BasicOperations.cs b/Core.Arango.Tests/LinqTest_BasicOperations.cs index 46d68ebb63..d2961ecf31 100644 --- a/Core.Arango.Tests/LinqTest_BasicOperations.cs +++ b/Core.Arango.Tests/LinqTest_BasicOperations.cs @@ -1,13 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Threading.Tasks; +using Core.Arango.Linq; using Core.Arango.Protocol; -using Core.Arango.Linq; using Core.Arango.Tests.Core; using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; diff --git a/Core.Arango.Tests/LinqTest_String.cs b/Core.Arango.Tests/LinqTest_String.cs index a7726a3d22..36d5a9e03d 100644 --- a/Core.Arango.Tests/LinqTest_String.cs +++ b/Core.Arango.Tests/LinqTest_String.cs @@ -1,13 +1,10 @@ -using System; +using Core.Arango.Linq; +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; +using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; using System.Linq; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Linq; -using Core.Arango.Tests.Core; -using Newtonsoft.Json; using Xunit; using Xunit.Abstractions; @@ -27,7 +24,7 @@ public async Task StringConcat() { var q = Arango.Query("test").Where(x => String.Concat(x.Name, " 10") == "Project A 10"); var p = await q.FirstOrDefaultAsync(); - + Assert.Equal("Project A", p.Name); //_output.WriteLine(q.ToAql().aql); } @@ -162,7 +159,7 @@ public async Task StringIndexOf() { var q = Arango.Query("test").Where(x => x.Name.IndexOf("A") == "Project A".IndexOf("A")); var p = await q.FirstOrDefaultAsync(); - + Assert.Equal("Project A", p.Name); //_output.WriteLine(q.ToAql().aql); } diff --git a/Core.Arango.Tests/QueryFormattingTest.cs b/Core.Arango.Tests/QueryFormattingTest.cs index be1772281f..f4faf11043 100644 --- a/Core.Arango.Tests/QueryFormattingTest.cs +++ b/Core.Arango.Tests/QueryFormattingTest.cs @@ -1,8 +1,8 @@ +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; using System; using System.Linq; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Tests.Core; using Xunit; namespace Core.Arango.Tests diff --git a/Core.Arango.Tests/QueryStatisticTest.cs b/Core.Arango.Tests/QueryStatisticTest.cs index 2ab326ba37..1873f6b76e 100644 --- a/Core.Arango.Tests/QueryStatisticTest.cs +++ b/Core.Arango.Tests/QueryStatisticTest.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Core.Arango.Protocol; using Core.Arango.Tests.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; @@ -52,7 +52,7 @@ public async Task QueryStats() new() {Value = 5} }); - var select = new List {1, 2, 3}; + var select = new List { 1, 2, 3 }; var res = await Arango.Query.ExecuteAsync("test", $"FOR e IN test FILTER e.Value IN {select} LIMIT 2 RETURN e", fullCount: true); diff --git a/Core.Arango.Tests/QueryTest.cs b/Core.Arango.Tests/QueryTest.cs index ede41e576e..7200fa5f09 100644 --- a/Core.Arango.Tests/QueryTest.cs +++ b/Core.Arango.Tests/QueryTest.cs @@ -1,24 +1,17 @@ +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Tests.Core; -using Newtonsoft.Json; using Xunit; using Xunit.Abstractions; namespace Core.Arango.Tests { - public class QueryTest : TestBase + public class QueryTest(ITestOutputHelper output) : TestBase { - private readonly ITestOutputHelper _output; - - public QueryTest(ITestOutputHelper output) - { - _output = output; - } - [Theory] [ClassData(typeof(PascalCaseData))] public async Task NullParameter(string serializer) @@ -33,11 +26,9 @@ public async Task NullParameter(string serializer) }); Guid? nullParam = null; - - var res = await Arango.Query.SingleOrDefaultAsync("test", "test", + _ = await Arango.Query.SingleOrDefaultAsync("test", "test", $"x.Value == {nullParam}"); - - var res2 = await Arango.Query.SingleOrDefaultAsync("test", "test", + _ = await Arango.Query.SingleOrDefaultAsync("test", "test", $"x.Value == {null}"); } @@ -54,7 +45,7 @@ public async Task QueryIntegerContains(string serializer) new() {Value = 3} }); - var select = new List {1, 2}; + var select = new List { 1, 2 }; var res = await Arango.Query.ExecuteAsync("test", $"FOR e IN test FILTER e.Value IN {select} RETURN e"); @@ -118,7 +109,7 @@ public async Task Batch(string serializer) await Arango.Document.CreateManyAsync("test", "test", Enumerable.Range(1, 100000) - .Select(x => new Entity {Value = x})); + .Select(x => new Entity { Value = x })); var res = await Arango.Query.ExecuteAsync("test", $"FOR e IN test RETURN e._id"); @@ -135,7 +126,7 @@ public async Task BatchStream(string serializer) await Arango.Document.CreateManyAsync("test", "test", Enumerable.Range(1, 100000) - .Select(x => new Entity {Value = x})); + .Select(x => new Entity { Value = x })); var i = 0; @@ -159,12 +150,12 @@ public async Task Explain(string serializer) new() {Value = 3} }); - var select = new List {1, 2}; + var select = new List { 1, 2 }; var res = await Arango.Query.ExplainAsync("test", $"FOR e IN test FILTER e.Value IN {select} RETURN e"); - _output.WriteLine(JsonConvert.SerializeObject(res, Formatting.Indented)); + output.WriteLine(JsonConvert.SerializeObject(res, Formatting.Indented)); } [Theory] @@ -177,7 +168,7 @@ public async Task Parse(string serializer) var res = await Arango.Query.ParseAsync("test", "FOR e IN test FILTER e.Value IN [1,2,3] RETURN e"); - _output.WriteLine(JsonConvert.SerializeObject(res, Formatting.Indented)); + output.WriteLine(JsonConvert.SerializeObject(res, Formatting.Indented)); } } } \ No newline at end of file diff --git a/Core.Arango.Tests/Serializer.cs b/Core.Arango.Tests/Serializer.cs index 806be072af..e0fa540d13 100644 --- a/Core.Arango.Tests/Serializer.cs +++ b/Core.Arango.Tests/Serializer.cs @@ -1,13 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Net.Http; -using System.Net.Http.Headers; -using Core.Arango.Serialization; +using Core.Arango.Serialization; using Core.Arango.Serialization.Json; using Core.Arango.Serialization.Newtonsoft; using Core.Arango.Tests.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; using Xunit; using Xunit.Abstractions; @@ -63,7 +61,7 @@ public void Equality(IArangoSerializer serializer, string name) public void Performance(IArangoSerializer serializer, string name) { var docs = Enumerable.Range(1, 100000) - .Select(x => new Entity {Value = x}); + .Select(x => new Entity { Value = x }); var sw = new Stopwatch(); sw.Start(); diff --git a/Core.Arango.Tests/TransactionTest.cs b/Core.Arango.Tests/TransactionTest.cs index b986c22811..124ee67d3c 100644 --- a/Core.Arango.Tests/TransactionTest.cs +++ b/Core.Arango.Tests/TransactionTest.cs @@ -1,10 +1,10 @@ +using Core.Arango.Protocol; +using Core.Arango.Tests.Core; +using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Tests.Core; -using Newtonsoft.Json.Linq; using Xunit; namespace Core.Arango.Tests @@ -22,7 +22,7 @@ public async Task StreamTransaction(string serializer) { Collections = new ArangoTransactionScope { - Write = new List {"test"} + Write = new List { "test" } } }); @@ -41,7 +41,7 @@ public async Task StreamTransaction(string serializer) { Collections = new ArangoTransactionScope { - Write = new List {"test"} + Write = new List { "test" } } }); @@ -76,7 +76,7 @@ public async Task StreamTransactionQuery(string serializer) { Collections = new ArangoTransactionScope { - Write = new List {"test"} + Write = new List { "test" } } }); @@ -93,7 +93,7 @@ public async Task StreamTransactionQuery(string serializer) { Collections = new ArangoTransactionScope { - Write = new List {"test"} + Write = new List { "test" } } }); @@ -138,13 +138,13 @@ async Task AssertStreamQuery(ArangoHandle handle, int expected) { Collections = new ArangoTransactionScope { - Write = new List {"test"} + Write = new List { "test" } } }); await Arango.Document.CreateManyAsync(t1, "test", Enumerable.Range(1, 100000) - .Select(x => new Entity {Value = x})); + .Select(x => new Entity { Value = x })); await AssertStreamQuery(t1, 100000); @@ -156,13 +156,13 @@ await Arango.Document.CreateManyAsync(t1, "test", { Collections = new ArangoTransactionScope { - Write = new List {"test"} + Write = new List { "test" } } }); await Arango.Document.CreateManyAsync(t2, "test", Enumerable.Range(1, 100000) - .Select(x => new Entity {Value = x})); + .Select(x => new Entity { Value = x })); await AssertStreamQuery(t2, 200000); await AssertStreamQuery("test", 100000); diff --git a/Core.Arango/ArangoConfiguration.cs b/Core.Arango/ArangoConfiguration.cs index 7525822b85..1b8ec6df63 100644 --- a/Core.Arango/ArangoConfiguration.cs +++ b/Core.Arango/ArangoConfiguration.cs @@ -1,137 +1,128 @@ -using System; -using System.Collections.Generic; -using System.Data.Common; -using System.Linq; -using System.Net.Http; -using System.Reflection; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; using Core.Arango.Protocol; using Core.Arango.Serialization; using Core.Arango.Serialization.Newtonsoft; using Core.Arango.Transport; +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Linq; +using System.Reflection; +using System.Net.Http; -namespace Core.Arango +namespace Core.Arango; + +/// +/// Driver configuration. +/// +public class ArangoConfiguration : IArangoConfiguration { + private string _connectionString; + /// - /// Driver configuration. /// - public class ArangoConfiguration : IArangoConfiguration + public ArangoConfiguration() { - private string _connectionString; - - /// - /// - public ArangoConfiguration() + BatchSize = 500; + Serializer = new ArangoNewtonsoftSerializer(new ArangoNewtonsoftDefaultContractResolver()); + Transport = new ArangoHttpTransport(this); + ResolveCollection = type => { - BatchSize = 500; - Serializer = new ArangoNewtonsoftSerializer(new ArangoNewtonsoftDefaultContractResolver()); - Transport = new ArangoHttpTransport(this); - ResolveCollection = type => - { - var attr = type.GetCustomAttribute(); + var attr = type.GetCustomAttribute(); - if (attr != null) - return attr.CollectionName; + if (attr != null) + return attr.CollectionName; - return type.Name; - }; - ResolveProperty = (type, name) => + return type.Name; + }; + ResolveProperty = (type, name) => + { + return name switch { - switch (name) - { - case "Key": - return "_key"; - case "Id": - return "_id"; - case "Revision": - return "_rev"; - case "From": - return "_from"; - case "To": - return "_to"; - } - + "Key" => "_key", + "Id" => "_id", + "Revision" => "_rev", + "From" => "_from", + "To" => "_to", // TODO: camelCase - return name; + _ => name, }; - ResolveGroupBy = s => s; - } - - /// - public string ConnectionString + }; + ResolveGroupBy = s => s; + } + + /// + public string ConnectionString + { + get => _connectionString; + set { - get => _connectionString; - set - { - _connectionString = value; - var builder = new DbConnectionStringBuilder {ConnectionString = value}; - builder.TryGetValue("Server", out var s); - builder.TryGetValue("Realm", out var r); - builder.TryGetValue("User ID", out var uid); - builder.TryGetValue("User", out var u); - builder.TryGetValue("Password", out var p); - builder.TryGetValue("AllowDirtyRead", out var dr); - builder.TryGetValue("Endpoints", out var eps); - - var server = s as string; - var user = u as string ?? uid as string; - var password = p as string; - var realm = r as string; - var allowDirtyRead = dr as string; - var endpoints = dr as string; - - if (string.IsNullOrWhiteSpace(server)) - throw new ArgumentException("Server invalid"); - - Realm = realm; - Server = server; - User = user; - Password = password; - - Endpoints = endpoints?.SplitAndRemoveEmptyEntries(',').ToList(); - - if (allowDirtyRead?.Equals("true", StringComparison.InvariantCultureIgnoreCase) == true) - AllowDirtyRead = true; - } + _connectionString = value; + var builder = new DbConnectionStringBuilder { ConnectionString = value }; + builder.TryGetValue("Server", out var s); + builder.TryGetValue("Realm", out var r); + builder.TryGetValue("User ID", out var uid); + builder.TryGetValue("User", out var u); + builder.TryGetValue("Password", out var p); + builder.TryGetValue("AllowDirtyRead", out var dr); + builder.TryGetValue("Endpoints", out _); + + var server = s as string; + var user = u as string ?? uid as string; + var password = p as string; + var realm = r as string; + var allowDirtyRead = dr as string; + var endpoints = dr as string; + + if (string.IsNullOrWhiteSpace(server)) + throw new ArgumentException("Server invalid"); + + Realm = realm; + Server = server; + User = user; + Password = password; + + Endpoints = endpoints?.SplitAndRemoveEmptyEntries(',').ToList(); + + if (allowDirtyRead?.Equals("true", StringComparison.InvariantCultureIgnoreCase) == true) + AllowDirtyRead = true; } + } - /// - public string Realm { get; set; } - - /// - public string Server { get; set; } - - /// - public string User { get; set; } + /// + public string Realm { get; set; } - /// - public string Password { get; set; } + /// + public string Server { get; set; } - /// - public int BatchSize { get; set; } + /// + public string User { get; set; } - /// - public IArangoSerializer Serializer { get; set; } + /// + public string Password { get; set; } - /// - public IArangoTransport Transport { get; set; } + /// + public int BatchSize { get; set; } - /// - public Action, ArangoQueryStatistic> QueryProfile { get; set; } + /// + public IArangoSerializer Serializer { get; set; } - /// - public HttpClient HttpClient { get; set; } + /// + public IArangoTransport Transport { get; set; } - /// - public bool AllowDirtyRead { get; set; } + /// + public Action, ArangoQueryStatistic> QueryProfile { get; set; } + /// + public HttpClient HttpClient { get; set; } + /// + public bool AllowDirtyRead { get; set; } - /// - public IReadOnlyList Endpoints { get; set; } - /// - public Func ResolveProperty { get; set; } - /// - public Func ResolveCollection { get; set; } - /// - public Func ResolveGroupBy { get; set; } - } + /// + public IReadOnlyList Endpoints { get; set; } + /// + public Func ResolveProperty { get; set; } + /// + public Func ResolveCollection { get; set; } + /// + public Func ResolveGroupBy { get; set; } } \ No newline at end of file diff --git a/Core.Arango/ArangoContext.cs b/Core.Arango/ArangoContext.cs index 76d7a54b0c..c2eee40ae7 100644 --- a/Core.Arango/ArangoContext.cs +++ b/Core.Arango/ArangoContext.cs @@ -1,4 +1,8 @@ -using System; +using Core.Arango.Modules; +using Core.Arango.Modules.Internal; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -6,10 +10,6 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Modules; -using Core.Arango.Modules.Internal; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango { diff --git a/Core.Arango/ArangoDependencyInjectionExtension.cs b/Core.Arango/ArangoDependencyInjectionExtension.cs index dc626868f6..1a4e2653c8 100644 --- a/Core.Arango/ArangoDependencyInjectionExtension.cs +++ b/Core.Arango/ArangoDependencyInjectionExtension.cs @@ -1,5 +1,5 @@ -using System; using Microsoft.Extensions.DependencyInjection; +using System; namespace Core.Arango { diff --git a/Core.Arango/ArangoException.cs b/Core.Arango/ArangoException.cs index 11c7532ed3..768016a6d7 100644 --- a/Core.Arango/ArangoException.cs +++ b/Core.Arango/ArangoException.cs @@ -1,9 +1,9 @@ -using System; +using Core.Arango.Protocol; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Net; -using Core.Arango.Protocol; namespace Core.Arango { diff --git a/Core.Arango/Core.Arango.csproj b/Core.Arango/Core.Arango.csproj index 2b3e8350b5..9c26ff12a8 100644 --- a/Core.Arango/Core.Arango.csproj +++ b/Core.Arango/Core.Arango.csproj @@ -1,16 +1,16 @@  - netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0 + net8.0 Corona Bytes - Andreas Dominik Jung - Core.Arango - arangodb driver + Palash Karmaker, Andreas Dominik Jung + Core.Arango.Net + arangodb driver for .Net 8 .NET driver for ArangoDB with support for database per tenant deployments Apache-2.0 - 3.0.0 - Andreas Dominik Jung + 1.0.7 + Palash Karmaker, Andreas Dominik Jung true ArangoDB.png @@ -20,7 +20,6 @@ snupkg https://github.com/coronabytes/dotnet-arangodb.git git - 9 @@ -32,37 +31,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/Core.Arango/Core.Arango.xml b/Core.Arango/Core.Arango.xml index 90bf79307d..99eb52cd2a 100644 --- a/Core.Arango/Core.Arango.xml +++ b/Core.Arango/Core.Arango.xml @@ -10234,6 +10234,15 @@ + + + + + + + + + @@ -10347,6 +10356,15 @@ + + + + + + + + + Arango HTTP 1.1/2.0 Transport Implementation @@ -10357,15 +10375,25 @@ Arango HTTP 1.1/2.0 Transport Implementation - + - + + + + + + + When using Basic auth, call this method to set the username and password + used in requests to ArangoDB. + + + Arango Transport Interface diff --git a/Core.Arango/IArangoConfiguration.cs b/Core.Arango/IArangoConfiguration.cs index 546760d9bb..a6a9da11b0 100644 --- a/Core.Arango/IArangoConfiguration.cs +++ b/Core.Arango/IArangoConfiguration.cs @@ -1,9 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; -using Core.Arango.Protocol; +using Core.Arango.Protocol; using Core.Arango.Serialization; using Core.Arango.Transport; +using System; +using System.Collections.Generic; +using System.Net.Http; namespace Core.Arango { @@ -65,7 +65,6 @@ public interface IArangoConfiguration /// HttpClient HttpClient { get; set; } - /// /// Enables read queries from followers /// diff --git a/Core.Arango/IArangoContext.cs b/Core.Arango/IArangoContext.cs index 9104fb1eba..85c9605158 100644 --- a/Core.Arango/IArangoContext.cs +++ b/Core.Arango/IArangoContext.cs @@ -1,9 +1,8 @@ -using System; +using Core.Arango.Modules; +using Core.Arango.Protocol; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Modules; -using Core.Arango.Protocol; namespace Core.Arango { diff --git a/Core.Arango/Linq/Aql.Array.cs b/Core.Arango/Linq/Aql.Array.cs index cd25109712..1c6b46938c 100644 --- a/Core.Arango/Linq/Aql.Array.cs +++ b/Core.Arango/Linq/Aql.Array.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Core.Arango.Linq.Attributes; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Aql.Date.cs b/Core.Arango/Linq/Aql.Date.cs index 2e0ceb5068..5777360615 100644 --- a/Core.Arango/Linq/Aql.Date.cs +++ b/Core.Arango/Linq/Aql.Date.cs @@ -1,6 +1,6 @@ -using System; +using Core.Arango.Linq.Attributes; +using System; using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Aql.Geo.cs b/Core.Arango/Linq/Aql.Geo.cs index d4f5e1771a..012cc78f3b 100644 --- a/Core.Arango/Linq/Aql.Geo.cs +++ b/Core.Arango/Linq/Aql.Geo.cs @@ -1,5 +1,5 @@ -using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; +using System.Diagnostics.CodeAnalysis; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Aql.Misc.cs b/Core.Arango/Linq/Aql.Misc.cs index 19d380b9e8..a57b10763d 100644 --- a/Core.Arango/Linq/Aql.Misc.cs +++ b/Core.Arango/Linq/Aql.Misc.cs @@ -1,6 +1,6 @@ -using System; +using Core.Arango.Linq.Attributes; +using System; using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Aql.Numeric.cs b/Core.Arango/Linq/Aql.Numeric.cs index d6a484638e..592042cac3 100644 --- a/Core.Arango/Linq/Aql.Numeric.cs +++ b/Core.Arango/Linq/Aql.Numeric.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Core.Arango.Linq.Attributes; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Aql.String.cs b/Core.Arango/Linq/Aql.String.cs index adb8809ac3..30bbf337c5 100644 --- a/Core.Arango/Linq/Aql.String.cs +++ b/Core.Arango/Linq/Aql.String.cs @@ -1,5 +1,5 @@ -using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; +using System.Diagnostics.CodeAnalysis; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Aql.Type.cs b/Core.Arango/Linq/Aql.Type.cs index 802340c714..a1a2ed89a7 100644 --- a/Core.Arango/Linq/Aql.Type.cs +++ b/Core.Arango/Linq/Aql.Type.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Core.Arango.Linq.Attributes; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Aql.cs b/Core.Arango/Linq/Aql.cs index 6c54e88732..701f517a19 100644 --- a/Core.Arango/Linq/Aql.cs +++ b/Core.Arango/Linq/Aql.cs @@ -1,6 +1,6 @@ -using System; +using Core.Arango.Linq.Attributes; +using System; using System.Diagnostics.CodeAnalysis; -using Core.Arango.Linq.Attributes; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/ArangoContextExtension.cs b/Core.Arango/Linq/ArangoContextExtension.cs index 6527645f41..d60174bdd8 100644 --- a/Core.Arango/Linq/ArangoContextExtension.cs +++ b/Core.Arango/Linq/ArangoContextExtension.cs @@ -1,6 +1,5 @@ -using System; +using Core.Arango.Linq.Query; using System.Linq; -using Core.Arango.Linq.Query; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/ArangoQueryExtensions.cs b/Core.Arango/Linq/ArangoQueryExtensions.cs index 8a6f819955..cd93767e23 100644 --- a/Core.Arango/Linq/ArangoQueryExtensions.cs +++ b/Core.Arango/Linq/ArangoQueryExtensions.cs @@ -1,4 +1,6 @@ -using System; +using Core.Arango.Linq.Interface; +using Core.Arango.Linq.Query; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; @@ -6,8 +8,6 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Linq.Interface; -using Core.Arango.Linq.Query; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/ArangoShortestPathExtensions.cs b/Core.Arango/Linq/ArangoShortestPathExtensions.cs index 489ffa07f2..14a94869a1 100644 --- a/Core.Arango/Linq/ArangoShortestPathExtensions.cs +++ b/Core.Arango/Linq/ArangoShortestPathExtensions.cs @@ -1,10 +1,10 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using Core.Arango.Linq.Collection; +using Core.Arango.Linq.Collection; using Core.Arango.Linq.Data; using Core.Arango.Linq.Interface; using Core.Arango.Linq.Query; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/ArangoTraversalExtensions.cs b/Core.Arango/Linq/ArangoTraversalExtensions.cs index 4c58f29fc7..062f9c244d 100644 --- a/Core.Arango/Linq/ArangoTraversalExtensions.cs +++ b/Core.Arango/Linq/ArangoTraversalExtensions.cs @@ -1,10 +1,10 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using Core.Arango.Linq.Collection; +using Core.Arango.Linq.Collection; using Core.Arango.Linq.Data; using Core.Arango.Linq.Interface; using Core.Arango.Linq.Query; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Linq { diff --git a/Core.Arango/Linq/Attributes/CollectionPropertyAttribute.cs b/Core.Arango/Linq/Attributes/CollectionPropertyAttribute.cs index b0b0519ba3..e846f819b3 100644 --- a/Core.Arango/Linq/Attributes/CollectionPropertyAttribute.cs +++ b/Core.Arango/Linq/Attributes/CollectionPropertyAttribute.cs @@ -1,5 +1,5 @@ -using System; -using Core.Arango.Linq.Interface; +using Core.Arango.Linq.Interface; +using System; namespace Core.Arango.Linq.Attributes { diff --git a/Core.Arango/Linq/Data/BaseResult.cs b/Core.Arango/Linq/Data/BaseResult.cs index 858862efae..3cab9378d2 100644 --- a/Core.Arango/Linq/Data/BaseResult.cs +++ b/Core.Arango/Linq/Data/BaseResult.cs @@ -1,5 +1,5 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; namespace Core.Arango.Linq.Data { diff --git a/Core.Arango/Linq/Data/EdgeVertexResult.cs b/Core.Arango/Linq/Data/EdgeVertexResult.cs index c5453c5c0d..e460c51261 100644 --- a/Core.Arango/Linq/Data/EdgeVertexResult.cs +++ b/Core.Arango/Linq/Data/EdgeVertexResult.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; using Core.Arango.Linq.Interface; +using System.Collections.Generic; namespace Core.Arango.Linq.Data { diff --git a/Core.Arango/Linq/Data/QueryData.cs b/Core.Arango/Linq/Data/QueryData.cs index 9984907ca6..d586c74a71 100644 --- a/Core.Arango/Linq/Data/QueryData.cs +++ b/Core.Arango/Linq/Data/QueryData.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; using Core.Arango.Linq.Interface; using Newtonsoft.Json; +using System.Collections.Generic; namespace Core.Arango.Linq.Data { diff --git a/Core.Arango/Linq/Data/TraversalPathData.cs b/Core.Arango/Linq/Data/TraversalPathData.cs index 1faa97995a..85dca1c4fd 100644 --- a/Core.Arango/Linq/Data/TraversalPathData.cs +++ b/Core.Arango/Linq/Data/TraversalPathData.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; using Core.Arango.Linq.Interface; +using System.Collections.Generic; namespace Core.Arango.Linq.Data { diff --git a/Core.Arango/Linq/Data/TraversalResult.cs b/Core.Arango/Linq/Data/TraversalResult.cs index 642f381fcf..62f661037d 100644 --- a/Core.Arango/Linq/Data/TraversalResult.cs +++ b/Core.Arango/Linq/Data/TraversalResult.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; using Core.Arango.Linq.Interface; +using System.Collections.Generic; namespace Core.Arango.Linq.Data { diff --git a/Core.Arango/Linq/Internal/ArangoLinq.cs b/Core.Arango/Linq/Internal/ArangoLinq.cs index 9c27340ba7..d00e3401f5 100644 --- a/Core.Arango/Linq/Internal/ArangoLinq.cs +++ b/Core.Arango/Linq/Internal/ArangoLinq.cs @@ -1,42 +1,23 @@ -using System; +using Core.Arango.Linq.Interface; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Linq.Interface; -namespace Core.Arango.Linq -{ - internal class ArangoLinq : IArangoLinq - { - private readonly IArangoContext _context; - private readonly ArangoHandle _handle; +namespace Core.Arango.Linq; - public ArangoLinq(IArangoContext context, ArangoHandle handle) - { - _context = context; - _handle = handle; - } +internal class ArangoLinq(IArangoContext context, ArangoHandle handle) : IArangoLinq +{ + private readonly IArangoContext _context = context; + private readonly ArangoHandle _handle = handle; - public string ResolvePropertyName(Type t, string s) - { - return _context.Configuration.ResolveProperty(t, s); - } + public string ResolvePropertyName(Type t, string s) => _context.Configuration.ResolveProperty(t, s); - public string ResolveCollectionName(Type t) - { - return _context.Configuration.ResolveCollection(t); - } + public string ResolveCollectionName(Type t) => _context.Configuration.ResolveCollection(t); - public Func TranslateGroupByIntoName => _context.Configuration.ResolveGroupBy; + public Func TranslateGroupByIntoName => _context.Configuration.ResolveGroupBy; - public IAsyncEnumerable StreamAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default) - { - return _context.Query.ExecuteStreamAsync(_handle, query, bindVars, cancellationToken: cancellationToken); - } + public IAsyncEnumerable StreamAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default) => _context.Query.ExecuteStreamAsync(_handle, query, bindVars, cancellationToken: cancellationToken); - public async Task> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default) - { - return await _context.Query.ExecuteAsync(_handle, query, bindVars, cancellationToken: cancellationToken).ConfigureAwait(false); - } - } + public async Task> ExecuteAsync(string query, IDictionary bindVars, CancellationToken cancellationToken = default) => await _context.Query.ExecuteAsync(_handle, query, bindVars, cancellationToken: cancellationToken).ConfigureAwait(false); } \ No newline at end of file diff --git a/Core.Arango/Linq/Query/AqlParser.cs b/Core.Arango/Linq/Query/AqlParser.cs index da42256a08..38c8d1fcc9 100644 --- a/Core.Arango/Linq/Query/AqlParser.cs +++ b/Core.Arango/Linq/Query/AqlParser.cs @@ -1,12 +1,12 @@ -using System.Linq; -using System.Reflection; -using Core.Arango.Linq.Interface; +using Core.Arango.Linq.Interface; using Core.Arango.Linq.Query.Clause; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation; using Core.Arango.Relinq.Parsing.Structure; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; using Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders; +using System.Linq; +using System.Reflection; using GroupByExpressionNode = Core.Arango.Linq.Query.Clause.GroupByExpressionNode; using SkipExpressionNode = Core.Arango.Linq.Query.Clause.SkipExpressionNode; using TakeExpressionNode = Core.Arango.Linq.Query.Clause.TakeExpressionNode; diff --git a/Core.Arango/Linq/Query/ArangoExpressionTreeVisitor.cs b/Core.Arango/Linq/Query/ArangoExpressionTreeVisitor.cs index 9566dec284..5d3bd3e259 100644 --- a/Core.Arango/Linq/Query/ArangoExpressionTreeVisitor.cs +++ b/Core.Arango/Linq/Query/ArangoExpressionTreeVisitor.cs @@ -1,13 +1,13 @@ -using System; -using System.Collections; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Attributes; +using Core.Arango.Linq.Attributes; using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing; +using System; +using System.Collections; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query { @@ -60,7 +60,7 @@ protected override Expression VisitMethodCall(MethodCallExpression expression) else throw new InvalidOperationException($"Method {expression.Method.Name} is not supported in ArangoLinqProvider"); } - else if(expression.Method.Name == "Equals") + else if (expression.Method.Name == "Equals") { ModelVisitor.QueryText.Append(" ( "); @@ -122,7 +122,7 @@ protected override Expression VisitMethodCall(MethodCallExpression expression) methodName = aqlFunction.Name; prop = aqlFunction.IsProperty; } - + string argumentSeprator = null; var noParenthesis = MethodsWithNoParenthesis.TryGetValue(methodName, out argumentSeprator) || prop; @@ -383,7 +383,7 @@ private void VisitConstantValue(object value, Type type) if (type == typeof(bool)) { - ModelVisitor.QueryText.AppendFormat(" {0} ", (bool) value ? "true" : "false"); + ModelVisitor.QueryText.AppendFormat(" {0} ", (bool)value ? "true" : "false"); return; } @@ -492,7 +492,7 @@ protected override Expression VisitNew(NewExpression expression) if (!TreatNewWithoutBracket) ModelVisitor.QueryText.Append(" { "); - var e = (NewExpression) NamedExpression.CreateNewExpressionWithNamedArguments(ModelVisitor.Db, expression); + var e = (NewExpression)NamedExpression.CreateNewExpressionWithNamedArguments(ModelVisitor.Db, expression); for (var i = 0; i < e.Arguments.Count; i++) { Visit(e.Arguments[i]); diff --git a/Core.Arango/Linq/Query/ArangoModelVisitor.cs b/Core.Arango/Linq/Query/ArangoModelVisitor.cs index c069cc6de7..d0bd711585 100644 --- a/Core.Arango/Linq/Query/ArangoModelVisitor.cs +++ b/Core.Arango/Linq/Query/ArangoModelVisitor.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Text.Json; -using Core.Arango.Linq.Collection; +using Core.Arango.Linq.Collection; using Core.Arango.Linq.Data; using Core.Arango.Linq.Interface; using Core.Arango.Linq.Query.Clause; @@ -13,6 +7,12 @@ using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Clauses.ResultOperators; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Text.Json; namespace Core.Arango.Linq.Query { diff --git a/Core.Arango/Linq/Query/ArangoQueryExecuter.cs b/Core.Arango/Linq/Query/ArangoQueryExecuter.cs index 03472bbe46..b8e092ba61 100644 --- a/Core.Arango/Linq/Query/ArangoQueryExecuter.cs +++ b/Core.Arango/Linq/Query/ArangoQueryExecuter.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using Core.Arango.Linq.Interface; +using Core.Arango.Linq.Interface; using Core.Arango.Relinq; +using System.Collections.Generic; +using System.Linq; namespace Core.Arango.Linq.Query { diff --git a/Core.Arango/Linq/Query/ArangoQueryProvider.cs b/Core.Arango/Linq/Query/ArangoQueryProvider.cs index ec8df9ead5..fad7fab9a2 100644 --- a/Core.Arango/Linq/Query/ArangoQueryProvider.cs +++ b/Core.Arango/Linq/Query/ArangoQueryProvider.cs @@ -1,11 +1,11 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Data; +using Core.Arango.Linq.Data; using Core.Arango.Linq.Interface; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.Structure; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query { @@ -71,7 +71,7 @@ private void CheckQueryableType(Type queryableType) /// An that represents the query defined by . public override IQueryable CreateQuery(Expression expression) { - return (IQueryable) Activator.CreateInstance(QueryableType.MakeGenericType(typeof(T)), this, expression, + return (IQueryable)Activator.CreateInstance(QueryableType.MakeGenericType(typeof(T)), this, expression, db); } diff --git a/Core.Arango/Linq/Query/ArangoQueryable.cs b/Core.Arango/Linq/Query/ArangoQueryable.cs index acd9ac61ff..edd292b147 100644 --- a/Core.Arango/Linq/Query/ArangoQueryable.cs +++ b/Core.Arango/Linq/Query/ArangoQueryable.cs @@ -1,13 +1,13 @@ -using System; +using Core.Arango.Linq.Data; +using Core.Arango.Linq.Interface; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Linq.Data; -using Core.Arango.Linq.Interface; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure; namespace Core.Arango.Linq.Query { diff --git a/Core.Arango/Linq/Query/Clause/FilterClause.cs b/Core.Arango/Linq/Query/Clause/FilterClause.cs index 2b7a72b60a..120617407c 100644 --- a/Core.Arango/Linq/Query/Clause/FilterClause.cs +++ b/Core.Arango/Linq/Query/Clause/FilterClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/FilterExpressionNode.cs b/Core.Arango/Linq/Query/Clause/FilterExpressionNode.cs index db13e62d01..54b6af0ab1 100644 --- a/Core.Arango/Linq/Query/Clause/FilterExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/FilterExpressionNode.cs @@ -1,9 +1,9 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/GroupByClause.cs b/Core.Arango/Linq/Query/Clause/GroupByClause.cs index 455c49da68..e339bb7b3e 100644 --- a/Core.Arango/Linq/Query/Clause/GroupByClause.cs +++ b/Core.Arango/Linq/Query/Clause/GroupByClause.cs @@ -1,8 +1,8 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/GroupByExpressionNode.cs b/Core.Arango/Linq/Query/Clause/GroupByExpressionNode.cs index f64466d95d..e6c0aec51a 100644 --- a/Core.Arango/Linq/Query/Clause/GroupByExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/GroupByExpressionNode.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Utility; +using Core.Arango.Linq.Utility; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/ITraversalClause.cs b/Core.Arango/Linq/Query/Clause/ITraversalClause.cs index 2bc22f7bac..3150353602 100644 --- a/Core.Arango/Linq/Query/Clause/ITraversalClause.cs +++ b/Core.Arango/Linq/Query/Clause/ITraversalClause.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Core.Arango.Linq.Data; +using System.Collections.Generic; using System.Linq.Expressions; -using Core.Arango.Linq.Data; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/IgnoreModificationSelectExpressionNode.cs b/Core.Arango/Linq/Query/Clause/IgnoreModificationSelectExpressionNode.cs index 4e4af6c563..728ba24e42 100644 --- a/Core.Arango/Linq/Query/Clause/IgnoreModificationSelectExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/IgnoreModificationSelectExpressionNode.cs @@ -1,7 +1,7 @@ -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/InModificationExpressionNode.cs b/Core.Arango/Linq/Query/Clause/InModificationExpressionNode.cs index 3a9b662a0b..aebd48c578 100644 --- a/Core.Arango/Linq/Query/Clause/InModificationExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/InModificationExpressionNode.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/InsertClause.cs b/Core.Arango/Linq/Query/Clause/InsertClause.cs index 2ed25e3f48..5555dbbd9b 100644 --- a/Core.Arango/Linq/Query/Clause/InsertClause.cs +++ b/Core.Arango/Linq/Query/Clause/InsertClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/InsertExpressionNode.cs b/Core.Arango/Linq/Query/Clause/InsertExpressionNode.cs index f4d6ce7224..84326528b0 100644 --- a/Core.Arango/Linq/Query/Clause/InsertExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/InsertExpressionNode.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { @@ -57,7 +57,7 @@ protected override void ApplyNodeSpecificSemantics(QueryModel queryModel, queryModel.BodyClauses.Add(new InsertClause( WithSelector != null ? GetResolvedPredicate(clauseGenerationContext) : null, queryModel.MainFromClause.ItemName, - (Type) Collection.Value + (Type)Collection.Value )); } } diff --git a/Core.Arango/Linq/Query/Clause/LetClause.cs b/Core.Arango/Linq/Query/Clause/LetClause.cs index a7db04e5aa..47c0f57186 100644 --- a/Core.Arango/Linq/Query/Clause/LetClause.cs +++ b/Core.Arango/Linq/Query/Clause/LetClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/LetLambdaExpressionNode.cs b/Core.Arango/Linq/Query/Clause/LetLambdaExpressionNode.cs index 7e273f30c8..b9c974b1c3 100644 --- a/Core.Arango/Linq/Query/Clause/LetLambdaExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/LetLambdaExpressionNode.cs @@ -1,9 +1,9 @@ -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Utility; +using Core.Arango.Linq.Utility; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/LetSelectExpressionNode.cs b/Core.Arango/Linq/Query/Clause/LetSelectExpressionNode.cs index 217057e270..34bea66c17 100644 --- a/Core.Arango/Linq/Query/Clause/LetSelectExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/LetSelectExpressionNode.cs @@ -1,11 +1,11 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { @@ -87,7 +87,7 @@ public Expression GetResolvedAdaptedSelector(ClauseGenerationContext clauseGener var adaptedSelectorBody = Expression.New( _letConstruction.Constructor, - new[] {_letConstruction.Arguments[0], new QuerySourceReferenceExpression(letClause)}, + new[] { _letConstruction.Arguments[0], new QuerySourceReferenceExpression(letClause) }, _letConstruction.Members); return r.GetResolvedExpression(adaptedSelectorBody, Selector.Parameters[0], clauseGenerationContext); diff --git a/Core.Arango/Linq/Query/Clause/OptionsClause.cs b/Core.Arango/Linq/Query/Clause/OptionsClause.cs index c1fae8955b..208fc226c8 100644 --- a/Core.Arango/Linq/Query/Clause/OptionsClause.cs +++ b/Core.Arango/Linq/Query/Clause/OptionsClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/OptionsExpressionNode.cs b/Core.Arango/Linq/Query/Clause/OptionsExpressionNode.cs index c2882ad1f6..66bede1a65 100644 --- a/Core.Arango/Linq/Query/Clause/OptionsExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/OptionsExpressionNode.cs @@ -1,8 +1,7 @@ -using System.Linq; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/PartialUpdateClause.cs b/Core.Arango/Linq/Query/Clause/PartialUpdateClause.cs index 978b7b2530..274e2a4909 100644 --- a/Core.Arango/Linq/Query/Clause/PartialUpdateClause.cs +++ b/Core.Arango/Linq/Query/Clause/PartialUpdateClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/PartialUpdateExpressionNode.cs b/Core.Arango/Linq/Query/Clause/PartialUpdateExpressionNode.cs index d3fd20f98f..2ed47d8f93 100644 --- a/Core.Arango/Linq/Query/Clause/PartialUpdateExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/PartialUpdateExpressionNode.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/RemoveClause.cs b/Core.Arango/Linq/Query/Clause/RemoveClause.cs index 190c26b62c..68b7854bf4 100644 --- a/Core.Arango/Linq/Query/Clause/RemoveClause.cs +++ b/Core.Arango/Linq/Query/Clause/RemoveClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/RemoveExpressionNode.cs b/Core.Arango/Linq/Query/Clause/RemoveExpressionNode.cs index bc6f43bda5..cb0018e129 100644 --- a/Core.Arango/Linq/Query/Clause/RemoveExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/RemoveExpressionNode.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { @@ -55,7 +55,7 @@ protected override void ApplyNodeSpecificSemantics(QueryModel queryModel, queryModel.BodyClauses.Add(new RemoveClause( queryModel.MainFromClause.ItemName, - (Type) Collection.Value, + (Type)Collection.Value, KeySelector != null ? GetResolvedKeyPredicate(clauseGenerationContext) : null)); } } diff --git a/Core.Arango/Linq/Query/Clause/SelectExpressionNode.cs b/Core.Arango/Linq/Query/Clause/SelectExpressionNode.cs index a9ca623a71..549597a849 100644 --- a/Core.Arango/Linq/Query/Clause/SelectExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/SelectExpressionNode.cs @@ -1,8 +1,8 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/SelectModificationExpressionNode.cs b/Core.Arango/Linq/Query/Clause/SelectModificationExpressionNode.cs index 3632660144..209ead23e8 100644 --- a/Core.Arango/Linq/Query/Clause/SelectModificationExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/SelectModificationExpressionNode.cs @@ -1,9 +1,9 @@ -using System; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/ShortestPathExpressionNode.cs b/Core.Arango/Linq/Query/Clause/ShortestPathExpressionNode.cs index c2d1f2ea51..ad12ebf4d7 100644 --- a/Core.Arango/Linq/Query/Clause/ShortestPathExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/ShortestPathExpressionNode.cs @@ -1,12 +1,12 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Data; +using Core.Arango.Linq.Data; using Core.Arango.Linq.Utility; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/SkipExpressionNode.cs b/Core.Arango/Linq/Query/Clause/SkipExpressionNode.cs index 12f38ecf23..c8e81ee837 100644 --- a/Core.Arango/Linq/Query/Clause/SkipExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/SkipExpressionNode.cs @@ -1,8 +1,8 @@ -using System.Linq; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/SkipTakeClause.cs b/Core.Arango/Linq/Query/Clause/SkipTakeClause.cs index 5e34c378b4..f3ff104f72 100644 --- a/Core.Arango/Linq/Query/Clause/SkipTakeClause.cs +++ b/Core.Arango/Linq/Query/Clause/SkipTakeClause.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Clauses; +using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Clauses; namespace Core.Arango.Linq.Query.Clause { @@ -113,7 +113,7 @@ private T GetConstantValueFromExpression(string expressionName, Expression ex } var itemAsConstantExpression = expression as ConstantExpression; - if (itemAsConstantExpression != null) return (T) itemAsConstantExpression.Value; + if (itemAsConstantExpression != null) return (T)itemAsConstantExpression.Value; { var message = string.Format( diff --git a/Core.Arango/Linq/Query/Clause/TakeExpressionNode.cs b/Core.Arango/Linq/Query/Clause/TakeExpressionNode.cs index c2a6b1bb7f..a6767e1db0 100644 --- a/Core.Arango/Linq/Query/Clause/TakeExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/TakeExpressionNode.cs @@ -1,8 +1,8 @@ -using System.Linq; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/TraversalClause.cs b/Core.Arango/Linq/Query/Clause/TraversalClause.cs index e92ad3c30b..6d1a81f7bb 100644 --- a/Core.Arango/Linq/Query/Clause/TraversalClause.cs +++ b/Core.Arango/Linq/Query/Clause/TraversalClause.cs @@ -1,9 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using Core.Arango.Linq.Data; +using Core.Arango.Linq.Data; using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/TraversalDepthExpressionNode.cs b/Core.Arango/Linq/Query/Clause/TraversalDepthExpressionNode.cs index 5ee939a7fc..d0b2cf21dd 100644 --- a/Core.Arango/Linq/Query/Clause/TraversalDepthExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/TraversalDepthExpressionNode.cs @@ -1,8 +1,8 @@ -using System.Linq; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/TraversalDirectionExpressionNode.cs b/Core.Arango/Linq/Query/Clause/TraversalDirectionExpressionNode.cs index 5928549f1b..5ff324ddd6 100644 --- a/Core.Arango/Linq/Query/Clause/TraversalDirectionExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/TraversalDirectionExpressionNode.cs @@ -1,10 +1,10 @@ -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Collection; +using Core.Arango.Linq.Collection; using Core.Arango.Linq.Utility; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/TraversalEdgeExpressionNode.cs b/Core.Arango/Linq/Query/Clause/TraversalEdgeExpressionNode.cs index 584150c75a..7a5f023e20 100644 --- a/Core.Arango/Linq/Query/Clause/TraversalEdgeExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/TraversalEdgeExpressionNode.cs @@ -1,10 +1,10 @@ -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Collection; +using Core.Arango.Linq.Collection; using Core.Arango.Linq.Data; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/TraversalExpressionNode.cs b/Core.Arango/Linq/Query/Clause/TraversalExpressionNode.cs index fff9cfd21b..e3c44f4319 100644 --- a/Core.Arango/Linq/Query/Clause/TraversalExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/TraversalExpressionNode.cs @@ -1,12 +1,12 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Core.Arango.Linq.Data; +using Core.Arango.Linq.Data; using Core.Arango.Linq.Utility; using Core.Arango.Relinq; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/TraversalGraphNameExpressionNode.cs b/Core.Arango/Linq/Query/Clause/TraversalGraphNameExpressionNode.cs index ace3ff3bf5..b99d35a0af 100644 --- a/Core.Arango/Linq/Query/Clause/TraversalGraphNameExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/TraversalGraphNameExpressionNode.cs @@ -1,8 +1,8 @@ -using System.Linq; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/TraversalOptionsExpressionNode.cs b/Core.Arango/Linq/Query/Clause/TraversalOptionsExpressionNode.cs index c5fb294a58..064a5df64e 100644 --- a/Core.Arango/Linq/Query/Clause/TraversalOptionsExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/TraversalOptionsExpressionNode.cs @@ -1,8 +1,8 @@ -using System.Linq; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/UpdateReplaceClause.cs b/Core.Arango/Linq/Query/Clause/UpdateReplaceClause.cs index 6e7f0378c2..d24d0944ed 100644 --- a/Core.Arango/Linq/Query/Clause/UpdateReplaceClause.cs +++ b/Core.Arango/Linq/Query/Clause/UpdateReplaceClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/UpdateReplaceExpressionNode.cs b/Core.Arango/Linq/Query/Clause/UpdateReplaceExpressionNode.cs index 121db779d0..b7b20c0153 100644 --- a/Core.Arango/Linq/Query/Clause/UpdateReplaceExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/UpdateReplaceExpressionNode.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/UpsertClause.cs b/Core.Arango/Linq/Query/Clause/UpsertClause.cs index fba0a225c2..78ee08ef7c 100644 --- a/Core.Arango/Linq/Query/Clause/UpsertClause.cs +++ b/Core.Arango/Linq/Query/Clause/UpsertClause.cs @@ -1,7 +1,7 @@ -using System; -using System.Linq.Expressions; -using Core.Arango.Relinq; +using Core.Arango.Relinq; using Core.Arango.Relinq.Clauses; +using System; +using System.Linq.Expressions; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/Clause/UpsertExpressionNode.cs b/Core.Arango/Linq/Query/Clause/UpsertExpressionNode.cs index 98791f24ad..f079d0d80a 100644 --- a/Core.Arango/Linq/Query/Clause/UpsertExpressionNode.cs +++ b/Core.Arango/Linq/Query/Clause/UpsertExpressionNode.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Relinq; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Linq.Query.Clause { diff --git a/Core.Arango/Linq/Query/ExpressionParameterRewriter.cs b/Core.Arango/Linq/Query/ExpressionParameterRewriter.cs index d6d9326554..6e812c0f57 100644 --- a/Core.Arango/Linq/Query/ExpressionParameterRewriter.cs +++ b/Core.Arango/Linq/Query/ExpressionParameterRewriter.cs @@ -28,7 +28,7 @@ public static Expression> RewriteParameterAt(Expres unchangedParams.RemoveAt(index); var newExpression = new ExpressionParameterRewriterVisitor(param, unchangedParams).Visit(exp); - return (Expression>) newExpression; + return (Expression>)newExpression; } private class ExpressionParameterRewriterVisitor : ExpressionVisitor diff --git a/Core.Arango/Linq/Query/LinqUtility.cs b/Core.Arango/Linq/Query/LinqUtility.cs index cccbf921cf..167fa6bf28 100644 --- a/Core.Arango/Linq/Query/LinqUtility.cs +++ b/Core.Arango/Linq/Query/LinqUtility.cs @@ -1,14 +1,14 @@ -using System; +using Core.Arango.Linq.Interface; +using Core.Arango.Linq.Query.Clause; +using Core.Arango.Linq.Utility; +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Linq.Interface; -using Core.Arango.Linq.Query.Clause; -using Core.Arango.Linq.Utility; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders; namespace Core.Arango.Linq.Query { @@ -29,9 +29,9 @@ private static MethodInfo GetMethod(Expression> wrappedCall) switch (wrappedCall.Body.NodeType) { case ExpressionType.Call: - return ((MethodCallExpression) wrappedCall.Body).Method; + return ((MethodCallExpression)wrappedCall.Body).Method; case ExpressionType.MemberAccess: - var memberExpression = (MemberExpression) wrappedCall.Body; + var memberExpression = (MemberExpression)wrappedCall.Body; var property = memberExpression.Member as PropertyInfo; var method = property != null ? property.GetMethod : null; if (method != null) diff --git a/Core.Arango/Linq/Query/NamedExpression.cs b/Core.Arango/Linq/Query/NamedExpression.cs index b48de9290f..bf9f88a207 100644 --- a/Core.Arango/Linq/Query/NamedExpression.cs +++ b/Core.Arango/Linq/Query/NamedExpression.cs @@ -1,10 +1,10 @@ -using System; +using Core.Arango.Linq.Interface; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Linq.Interface; namespace Core.Arango.Linq.Query { diff --git a/Core.Arango/Linq/Utility/ReflectionUtils.cs b/Core.Arango/Linq/Utility/ReflectionUtils.cs index 19a135a120..6b5ac07338 100644 --- a/Core.Arango/Linq/Utility/ReflectionUtils.cs +++ b/Core.Arango/Linq/Utility/ReflectionUtils.cs @@ -1,9 +1,9 @@ -using System; +using Core.Arango.Linq.Query; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; -using Core.Arango.Linq.Query; namespace Core.Arango.Linq.Utility { diff --git a/Core.Arango/Linq/Utility/Utils.cs b/Core.Arango/Linq/Utility/Utils.cs index 1f4e41eaec..53e43737ad 100644 --- a/Core.Arango/Linq/Utility/Utils.cs +++ b/Core.Arango/Linq/Utility/Utils.cs @@ -1,5 +1,5 @@ -using System; -using Core.Arango.Linq.Collection; +using Core.Arango.Linq.Collection; +using System; namespace Core.Arango.Linq.Utility { diff --git a/Core.Arango/Modules/IArangoAnalyzerModule.cs b/Core.Arango/Modules/IArangoAnalyzerModule.cs index 29d7249da0..27bad37282 100644 --- a/Core.Arango/Modules/IArangoAnalyzerModule.cs +++ b/Core.Arango/Modules/IArangoAnalyzerModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoBackupModule.cs b/Core.Arango/Modules/IArangoBackupModule.cs index 6a96e20868..24c8553287 100644 --- a/Core.Arango/Modules/IArangoBackupModule.cs +++ b/Core.Arango/Modules/IArangoBackupModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoCollectionModule.cs b/Core.Arango/Modules/IArangoCollectionModule.cs index 9f33ae4423..4b0737a69d 100644 --- a/Core.Arango/Modules/IArangoCollectionModule.cs +++ b/Core.Arango/Modules/IArangoCollectionModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoDatabaseModule.cs b/Core.Arango/Modules/IArangoDatabaseModule.cs index 1f69a3de06..12bc4e3aff 100644 --- a/Core.Arango/Modules/IArangoDatabaseModule.cs +++ b/Core.Arango/Modules/IArangoDatabaseModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoDocumentModule.cs b/Core.Arango/Modules/IArangoDocumentModule.cs index 9a9c9640d4..daec210ee1 100644 --- a/Core.Arango/Modules/IArangoDocumentModule.cs +++ b/Core.Arango/Modules/IArangoDocumentModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoFoxxModule.cs b/Core.Arango/Modules/IArangoFoxxModule.cs index 50578cc02b..dd423519e2 100644 --- a/Core.Arango/Modules/IArangoFoxxModule.cs +++ b/Core.Arango/Modules/IArangoFoxxModule.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoFunctionModule.cs b/Core.Arango/Modules/IArangoFunctionModule.cs index a3a0e3c055..3669e30591 100644 --- a/Core.Arango/Modules/IArangoFunctionModule.cs +++ b/Core.Arango/Modules/IArangoFunctionModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoGraphEdgeModule.cs b/Core.Arango/Modules/IArangoGraphEdgeModule.cs index aa7386d005..ba771525a2 100644 --- a/Core.Arango/Modules/IArangoGraphEdgeModule.cs +++ b/Core.Arango/Modules/IArangoGraphEdgeModule.cs @@ -1,6 +1,6 @@ -using System.Threading; +using Core.Arango.Protocol; +using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoGraphModule.cs b/Core.Arango/Modules/IArangoGraphModule.cs index bd3c275c74..7b807ea80f 100644 --- a/Core.Arango/Modules/IArangoGraphModule.cs +++ b/Core.Arango/Modules/IArangoGraphModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoGraphVertexModule.cs b/Core.Arango/Modules/IArangoGraphVertexModule.cs index 9eb7f00f45..e6e25b5803 100644 --- a/Core.Arango/Modules/IArangoGraphVertexModule.cs +++ b/Core.Arango/Modules/IArangoGraphVertexModule.cs @@ -1,6 +1,6 @@ -using System.Threading; +using Core.Arango.Protocol; +using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoIndexModule.cs b/Core.Arango/Modules/IArangoIndexModule.cs index 896af87858..2e8199547f 100644 --- a/Core.Arango/Modules/IArangoIndexModule.cs +++ b/Core.Arango/Modules/IArangoIndexModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoPregelModule.cs b/Core.Arango/Modules/IArangoPregelModule.cs index 9998f31a83..23163098b4 100644 --- a/Core.Arango/Modules/IArangoPregelModule.cs +++ b/Core.Arango/Modules/IArangoPregelModule.cs @@ -1,6 +1,6 @@ -using System.Threading; +using Core.Arango.Protocol; +using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoQueryModule.cs b/Core.Arango/Modules/IArangoQueryModule.cs index f059f9d510..4362ae078e 100644 --- a/Core.Arango/Modules/IArangoQueryModule.cs +++ b/Core.Arango/Modules/IArangoQueryModule.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Protocol; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoTransactionModule.cs b/Core.Arango/Modules/IArangoTransactionModule.cs index 2b50770fce..8dc8a5815f 100644 --- a/Core.Arango/Modules/IArangoTransactionModule.cs +++ b/Core.Arango/Modules/IArangoTransactionModule.cs @@ -1,6 +1,6 @@ -using System.Threading; +using Core.Arango.Protocol; +using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoUserModule.cs b/Core.Arango/Modules/IArangoUserModule.cs index aabf79205f..f6a124394d 100644 --- a/Core.Arango/Modules/IArangoUserModule.cs +++ b/Core.Arango/Modules/IArangoUserModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/IArangoViewModule.cs b/Core.Arango/Modules/IArangoViewModule.cs index 81527d61e7..0036bd4fa3 100644 --- a/Core.Arango/Modules/IArangoViewModule.cs +++ b/Core.Arango/Modules/IArangoViewModule.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules { diff --git a/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs b/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs index d7c522c930..2e306a2b68 100644 --- a/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs +++ b/Core.Arango/Modules/Internal/ArangoAnalyzerModule.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoBackupModule.cs b/Core.Arango/Modules/Internal/ArangoBackupModule.cs index fb38690d44..a0911eab41 100644 --- a/Core.Arango/Modules/Internal/ArangoBackupModule.cs +++ b/Core.Arango/Modules/Internal/ArangoBackupModule.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoCollectionModule.cs b/Core.Arango/Modules/Internal/ArangoCollectionModule.cs index 0841fd8830..6f0cb7ce9f 100644 --- a/Core.Arango/Modules/Internal/ArangoCollectionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoCollectionModule.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs b/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs index ec4782c8c8..25f3587be1 100644 --- a/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs +++ b/Core.Arango/Modules/Internal/ArangoDatabaseModule.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoDocumentModule.cs b/Core.Arango/Modules/Internal/ArangoDocumentModule.cs index e20e347ba8..7b8f10bf29 100644 --- a/Core.Arango/Modules/Internal/ArangoDocumentModule.cs +++ b/Core.Arango/Modules/Internal/ArangoDocumentModule.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoFoxxModule.cs b/Core.Arango/Modules/Internal/ArangoFoxxModule.cs index 98eb2af3c8..7c9a99faa9 100644 --- a/Core.Arango/Modules/Internal/ArangoFoxxModule.cs +++ b/Core.Arango/Modules/Internal/ArangoFoxxModule.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules.Internal { @@ -44,8 +44,7 @@ public async Task InstallServiceAsync(ArangoHandle database, if (legacy.HasValue) parameter.Add("legacy", legacy.Value.ToString().ToLowerInvariant()); - - var res = await Context.Configuration.Transport.SendContentAsync(HttpMethod.Post, + _ = await Context.Configuration.Transport.SendContentAsync(HttpMethod.Post, ApiPath(database, "foxx", parameter), PackService(service), cancellationToken: cancellationToken); @@ -70,8 +69,7 @@ public async Task ReplaceServiceAsync(ArangoHandle database, if (force.HasValue) parameter.Add("force", force.Value.ToString().ToLowerInvariant()); - - var res = await Context.Configuration.Transport.SendContentAsync(HttpMethod.Put, + _ = await Context.Configuration.Transport.SendContentAsync(HttpMethod.Put, ApiPath(database, "foxx/service", parameter), PackService(service), cancellationToken: cancellationToken); @@ -96,8 +94,7 @@ public async Task UpgradeServiceAsync(ArangoHandle database, if (force.HasValue) parameter.Add("force", force.Value.ToString().ToLowerInvariant()); - - var res = await Context.Configuration.Transport.SendContentAsync(PolyfillHelper.Patch, + _ = await Context.Configuration.Transport.SendContentAsync(PolyfillHelper.Patch, ApiPath(database, "foxx/service", parameter), PackService(service), cancellationToken: cancellationToken); @@ -256,7 +253,7 @@ public async Task DownloadServiceAsync(ArangoHandle database, string ApiPath(database, "foxx/download", parameter), cancellationToken: cancellationToken); - return await res.ReadAsStreamAsync(); + return await res.ReadAsStreamAsync(cancellationToken); } public async Task RunServiceScriptAsync(ArangoHandle database, string mount, string name, @@ -270,18 +267,14 @@ public async Task RunServiceScriptAsync(ArangoHandle database, string moun cancellationToken: cancellationToken); } - private MultipartFormDataContent PackService(ArangoFoxxSource service) + private static MultipartFormDataContent PackService(ArangoFoxxSource service) { var content = new MultipartFormDataContent(); if (service.JavaScript != null) - { content.Add(new StringContent(service.JavaScript, Encoding.UTF8, "application/javascript"), "source"); - } else if (service.Url != null) - { content.Add(new StringContent(service.Url), "source"); - } else if (service.ZipArchive != null) { var stream = new StreamContent(service.ZipArchive); @@ -289,10 +282,7 @@ private MultipartFormDataContent PackService(ArangoFoxxSource service) content.Add(stream, "source"); } else - { throw new ArangoException("Invalid service description"); - } - return content; } } diff --git a/Core.Arango/Modules/Internal/ArangoFunctionModule.cs b/Core.Arango/Modules/Internal/ArangoFunctionModule.cs index 74c1c14982..d64311463f 100644 --- a/Core.Arango/Modules/Internal/ArangoFunctionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoFunctionModule.cs @@ -1,10 +1,10 @@ -using System; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs b/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs index 2f0276b77e..cb89821ab5 100644 --- a/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs +++ b/Core.Arango/Modules/Internal/ArangoGraphEdgeModule.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoGraphModule.cs b/Core.Arango/Modules/Internal/ArangoGraphModule.cs index 190d7d4986..42a8c89427 100644 --- a/Core.Arango/Modules/Internal/ArangoGraphModule.cs +++ b/Core.Arango/Modules/Internal/ArangoGraphModule.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Net.Http; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; -using Newtonsoft.Json; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs b/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs index e2946d2339..edf1f74e41 100644 --- a/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs +++ b/Core.Arango/Modules/Internal/ArangoGraphVertexModule.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoIndexModule.cs b/Core.Arango/Modules/Internal/ArangoIndexModule.cs index 776acb8234..96d3049169 100644 --- a/Core.Arango/Modules/Internal/ArangoIndexModule.cs +++ b/Core.Arango/Modules/Internal/ArangoIndexModule.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Newtonsoft.Json; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoModule.cs b/Core.Arango/Modules/Internal/ArangoModule.cs index d5d2742eac..02fdc52db9 100644 --- a/Core.Arango/Modules/Internal/ArangoModule.cs +++ b/Core.Arango/Modules/Internal/ArangoModule.cs @@ -1,4 +1,5 @@ -using System; +using Core.Arango.Serialization; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; @@ -7,7 +8,6 @@ using System.Text.Encodings.Web; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Serialization; namespace Core.Arango.Modules.Internal { @@ -56,16 +56,10 @@ protected string FoxxPath(ArangoHandle handle, string path, IDictionary $"/_api/{path}"; [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected string UrlEncode(string value) - { - return UrlEncoder.Default.Encode(value); - } + protected static string UrlEncode(string value) => UrlEncoder.Default.Encode(value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public Task SendAsync(ArangoHandle handle, HttpMethod m, @@ -91,14 +85,11 @@ public Task SendAsync(Type type, HttpMethod m, string url, object body = headers, cancellationToken); } - public string AddQueryString(string uri, - IEnumerable> queryString) + public static string AddQueryString(string uri, IEnumerable> queryString) { - if (uri == null) - throw new ArgumentNullException(nameof(uri)); + ArgumentNullException.ThrowIfNull(uri); - if (queryString == null) - throw new ArgumentNullException(nameof(queryString)); + ArgumentNullException.ThrowIfNull(queryString); var anchorIndex = uri.IndexOf('#'); var uriToBeAppended = uri; @@ -106,12 +97,11 @@ public string AddQueryString(string uri, if (anchorIndex != -1) { - anchorText = uri.Substring(anchorIndex); - uriToBeAppended = uri.Substring(0, anchorIndex); + anchorText = uri[anchorIndex..]; + uriToBeAppended = uri[..anchorIndex]; } - var queryIndex = uriToBeAppended.IndexOf('?'); - var hasQuery = queryIndex != -1; + var hasQuery = uriToBeAppended.Contains('?'); var sb = new StringBuilder(); sb.Append(uriToBeAppended); @@ -128,7 +118,7 @@ public string AddQueryString(string uri, return sb.ToString(); } - public string Parameterize(FormattableString query, out IDictionary parameter) + public static string Parameterize(FormattableString query, out IDictionary parameter) { var formatter = new AqlQueryFormatter(); var queryExp = query.ToString(formatter); @@ -145,8 +135,7 @@ protected enum QueryParameterType protected class QueryFormattingContext { - private readonly IDictionary<(object value, QueryParameterType type), string> _paramsMap = - new Dictionary<(object obj, QueryParameterType type), string>(); + private readonly Dictionary<(object value, QueryParameterType type), string> _paramsMap = []; private int _counter; @@ -162,17 +151,12 @@ public string Register(QueryParameterType type, object value) { if (!_paramsMap.TryGetValue((value, type), out var paramName)) { - switch (type) + paramName = type switch { - case QueryParameterType.Regular: - paramName = $"@P{++_counter}"; - break; - case QueryParameterType.Collection: - paramName = $"@@C{++_counter}"; - break; - default: throw new ArgumentException($"Unsupported parameter type: {type:G}", nameof(type)); - } - + QueryParameterType.Regular => $"@P{++_counter}", + QueryParameterType.Collection => $"@@C{++_counter}", + _ => throw new ArgumentException($"Unsupported parameter type: {type:G}", nameof(type)), + }; _paramsMap.Add((value, type), paramName); } diff --git a/Core.Arango/Modules/Internal/ArangoPregelModule.cs b/Core.Arango/Modules/Internal/ArangoPregelModule.cs index ae22e79a8a..9d323f3b8f 100644 --- a/Core.Arango/Modules/Internal/ArangoPregelModule.cs +++ b/Core.Arango/Modules/Internal/ArangoPregelModule.cs @@ -1,7 +1,7 @@ -using System.Net.Http; +using Core.Arango.Protocol; +using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoQueryModule.cs b/Core.Arango/Modules/Internal/ArangoQueryModule.cs index 3aa3f3515f..d672c78580 100644 --- a/Core.Arango/Modules/Internal/ArangoQueryModule.cs +++ b/Core.Arango/Modules/Internal/ArangoQueryModule.cs @@ -1,12 +1,12 @@ -using System; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoTransactionModule.cs b/Core.Arango/Modules/Internal/ArangoTransactionModule.cs index fa97183294..df3752cf61 100644 --- a/Core.Arango/Modules/Internal/ArangoTransactionModule.cs +++ b/Core.Arango/Modules/Internal/ArangoTransactionModule.cs @@ -1,8 +1,8 @@ -using System.Net.Http; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoUserModule.cs b/Core.Arango/Modules/Internal/ArangoUserModule.cs index d80ee13b03..5d6aae7dd1 100644 --- a/Core.Arango/Modules/Internal/ArangoUserModule.cs +++ b/Core.Arango/Modules/Internal/ArangoUserModule.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/Modules/Internal/ArangoViewModule.cs b/Core.Arango/Modules/Internal/ArangoViewModule.cs index 030d62c802..5d6ef7838f 100644 --- a/Core.Arango/Modules/Internal/ArangoViewModule.cs +++ b/Core.Arango/Modules/Internal/ArangoViewModule.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; namespace Core.Arango.Modules.Internal { diff --git a/Core.Arango/PolyfillHelper.cs b/Core.Arango/PolyfillHelper.cs index a18e860269..073bac1f75 100644 --- a/Core.Arango/PolyfillHelper.cs +++ b/Core.Arango/PolyfillHelper.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net.Http; namespace Core.Arango diff --git a/Core.Arango/Protocol/ArangoAccess.cs b/Core.Arango/Protocol/ArangoAccess.cs index ef7467cf1d..95c0a2c7a8 100644 --- a/Core.Arango/Protocol/ArangoAccess.cs +++ b/Core.Arango/Protocol/ArangoAccess.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json; using Newtonsoft.Json.Converters; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoAnalyzer.cs b/Core.Arango/Protocol/ArangoAnalyzer.cs index 0b2f6d382a..d7504cd42c 100644 --- a/Core.Arango/Protocol/ArangoAnalyzer.cs +++ b/Core.Arango/Protocol/ArangoAnalyzer.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoAnalyzerBreakType.cs b/Core.Arango/Protocol/ArangoAnalyzerBreakType.cs index 6fd8ff705a..5d84e2dc17 100644 --- a/Core.Arango/Protocol/ArangoAnalyzerBreakType.cs +++ b/Core.Arango/Protocol/ArangoAnalyzerBreakType.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoAnalyzerCase.cs b/Core.Arango/Protocol/ArangoAnalyzerCase.cs index fb9bcb32f2..73fa82e917 100644 --- a/Core.Arango/Protocol/ArangoAnalyzerCase.cs +++ b/Core.Arango/Protocol/ArangoAnalyzerCase.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoAnalyzerGeoJsonType.cs b/Core.Arango/Protocol/ArangoAnalyzerGeoJsonType.cs index d2dc11a556..9a8d9593d9 100644 --- a/Core.Arango/Protocol/ArangoAnalyzerGeoJsonType.cs +++ b/Core.Arango/Protocol/ArangoAnalyzerGeoJsonType.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoAnalyzerProperties.cs b/Core.Arango/Protocol/ArangoAnalyzerProperties.cs index e881d2e77d..c696a704d3 100644 --- a/Core.Arango/Protocol/ArangoAnalyzerProperties.cs +++ b/Core.Arango/Protocol/ArangoAnalyzerProperties.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoAnalyzerType.cs b/Core.Arango/Protocol/ArangoAnalyzerType.cs index 72d65e513f..386b352b86 100644 --- a/Core.Arango/Protocol/ArangoAnalyzerType.cs +++ b/Core.Arango/Protocol/ArangoAnalyzerType.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoAstNode.cs b/Core.Arango/Protocol/ArangoAstNode.cs index 6fb69b7d78..6d1e8d729e 100644 --- a/Core.Arango/Protocol/ArangoAstNode.cs +++ b/Core.Arango/Protocol/ArangoAstNode.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoBackup.cs b/Core.Arango/Protocol/ArangoBackup.cs index cbb0124663..1bbc0ee655 100644 --- a/Core.Arango/Protocol/ArangoBackup.cs +++ b/Core.Arango/Protocol/ArangoBackup.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoBackupRequest.cs b/Core.Arango/Protocol/ArangoBackupRequest.cs index 77b276c809..020ec92eb9 100644 --- a/Core.Arango/Protocol/ArangoBackupRequest.cs +++ b/Core.Arango/Protocol/ArangoBackupRequest.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoCollection.cs b/Core.Arango/Protocol/ArangoCollection.cs index 27087004c7..06d5701129 100644 --- a/Core.Arango/Protocol/ArangoCollection.cs +++ b/Core.Arango/Protocol/ArangoCollection.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoCollectionUpdate.cs b/Core.Arango/Protocol/ArangoCollectionUpdate.cs index b67701d0fc..8908ae03cd 100644 --- a/Core.Arango/Protocol/ArangoCollectionUpdate.cs +++ b/Core.Arango/Protocol/ArangoCollectionUpdate.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoComputeOn.cs b/Core.Arango/Protocol/ArangoComputeOn.cs index f99b2b0d38..53a13ee19d 100644 --- a/Core.Arango/Protocol/ArangoComputeOn.cs +++ b/Core.Arango/Protocol/ArangoComputeOn.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoComputedValue.cs b/Core.Arango/Protocol/ArangoComputedValue.cs index 17009cf311..0065febc0e 100644 --- a/Core.Arango/Protocol/ArangoComputedValue.cs +++ b/Core.Arango/Protocol/ArangoComputedValue.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoCursor.cs b/Core.Arango/Protocol/ArangoCursor.cs index c128ea2d45..cecb0ed7f2 100644 --- a/Core.Arango/Protocol/ArangoCursor.cs +++ b/Core.Arango/Protocol/ArangoCursor.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoDatabase.cs b/Core.Arango/Protocol/ArangoDatabase.cs index d2de32a01d..12ba0bb29c 100644 --- a/Core.Arango/Protocol/ArangoDatabase.cs +++ b/Core.Arango/Protocol/ArangoDatabase.cs @@ -1,13 +1,13 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { /// - /// Arango Database - /// - public class ArangoDatabase + /// Arango Database + /// + public class ArangoDatabase { /// /// Has to contain a valid database name. @@ -15,7 +15,7 @@ public class ArangoDatabase [JsonPropertyName("name")] [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// Database Options /// diff --git a/Core.Arango/Protocol/ArangoDatabaseInfo.cs b/Core.Arango/Protocol/ArangoDatabaseInfo.cs index 8f35862858..57d939548a 100644 --- a/Core.Arango/Protocol/ArangoDatabaseInfo.cs +++ b/Core.Arango/Protocol/ArangoDatabaseInfo.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoDatabaseOptions.cs b/Core.Arango/Protocol/ArangoDatabaseOptions.cs index 8480eff628..b446f0f79a 100644 --- a/Core.Arango/Protocol/ArangoDatabaseOptions.cs +++ b/Core.Arango/Protocol/ArangoDatabaseOptions.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoEdgeDefinition.cs b/Core.Arango/Protocol/ArangoEdgeDefinition.cs index 507a16c3cd..3b6c2ab853 100644 --- a/Core.Arango/Protocol/ArangoEdgeDefinition.cs +++ b/Core.Arango/Protocol/ArangoEdgeDefinition.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoEdgeNgram.cs b/Core.Arango/Protocol/ArangoEdgeNgram.cs index b91011aef4..b1f97a132e 100644 --- a/Core.Arango/Protocol/ArangoEdgeNgram.cs +++ b/Core.Arango/Protocol/ArangoEdgeNgram.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoEdgeResponse.cs b/Core.Arango/Protocol/ArangoEdgeResponse.cs index bf51ad258c..8f788a5606 100644 --- a/Core.Arango/Protocol/ArangoEdgeResponse.cs +++ b/Core.Arango/Protocol/ArangoEdgeResponse.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoExplainResult.cs b/Core.Arango/Protocol/ArangoExplainResult.cs index 548f2503ae..314ad37470 100644 --- a/Core.Arango/Protocol/ArangoExplainResult.cs +++ b/Core.Arango/Protocol/ArangoExplainResult.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoFoxxService.cs b/Core.Arango/Protocol/ArangoFoxxService.cs index f396aed015..8932c1e383 100644 --- a/Core.Arango/Protocol/ArangoFoxxService.cs +++ b/Core.Arango/Protocol/ArangoFoxxService.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoFoxxSource.cs b/Core.Arango/Protocol/ArangoFoxxSource.cs index d925a5970d..47ae752356 100644 --- a/Core.Arango/Protocol/ArangoFoxxSource.cs +++ b/Core.Arango/Protocol/ArangoFoxxSource.cs @@ -23,7 +23,7 @@ private ArangoFoxxSource() /// public static ArangoFoxxSource FromZip(Stream zip) { - return new() {ZipArchive = zip}; + return new() { ZipArchive = zip }; } /// @@ -31,7 +31,7 @@ public static ArangoFoxxSource FromZip(Stream zip) /// public static ArangoFoxxSource FromJavaScript(string script) { - return new() {JavaScript = script}; + return new() { JavaScript = script }; } } } \ No newline at end of file diff --git a/Core.Arango/Protocol/ArangoFunctionDefinition.cs b/Core.Arango/Protocol/ArangoFunctionDefinition.cs index 2d8fda5dc3..db204501dc 100644 --- a/Core.Arango/Protocol/ArangoFunctionDefinition.cs +++ b/Core.Arango/Protocol/ArangoFunctionDefinition.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoGraph.cs b/Core.Arango/Protocol/ArangoGraph.cs index ed62feb631..b12062eed4 100644 --- a/Core.Arango/Protocol/ArangoGraph.cs +++ b/Core.Arango/Protocol/ArangoGraph.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoGraphOptions.cs b/Core.Arango/Protocol/ArangoGraphOptions.cs index 1ee0c93755..2910811e51 100644 --- a/Core.Arango/Protocol/ArangoGraphOptions.cs +++ b/Core.Arango/Protocol/ArangoGraphOptions.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoIndex.cs b/Core.Arango/Protocol/ArangoIndex.cs index 5a8e2a2246..26d8ef0d9d 100644 --- a/Core.Arango/Protocol/ArangoIndex.cs +++ b/Core.Arango/Protocol/ArangoIndex.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using JetBrains.Annotations; -using Newtonsoft.Json; namespace Core.Arango.Protocol { @@ -138,7 +137,7 @@ public class ArangoIndex /// [JsonPropertyName("storedValues")] [JsonProperty(PropertyName = "storedValues", NullValueHandling = NullValueHandling.Ignore)] - [System.Text.Json.Serialization.JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [System.Text.Json.Serialization.JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List StoredValues { get; set; } /// diff --git a/Core.Arango/Protocol/ArangoIndexType.cs b/Core.Arango/Protocol/ArangoIndexType.cs index ad518454f0..1b011fdb0d 100644 --- a/Core.Arango/Protocol/ArangoIndexType.cs +++ b/Core.Arango/Protocol/ArangoIndexType.cs @@ -1,8 +1,8 @@ -using System; +using Core.Arango.Serialization.Json; +using Newtonsoft.Json.Converters; +using System; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; -using Newtonsoft.Json.Converters; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoKeyOptions.cs b/Core.Arango/Protocol/ArangoKeyOptions.cs index 1b31762cfd..2926b0ec35 100644 --- a/Core.Arango/Protocol/ArangoKeyOptions.cs +++ b/Core.Arango/Protocol/ArangoKeyOptions.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoKeyType.cs b/Core.Arango/Protocol/ArangoKeyType.cs index bd339c4fd2..14070ffa7b 100644 --- a/Core.Arango/Protocol/ArangoKeyType.cs +++ b/Core.Arango/Protocol/ArangoKeyType.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoLinkProperty.cs b/Core.Arango/Protocol/ArangoLinkProperty.cs index 66eb1d6786..ee327229c5 100644 --- a/Core.Arango/Protocol/ArangoLinkProperty.cs +++ b/Core.Arango/Protocol/ArangoLinkProperty.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoNgramStreamType.cs b/Core.Arango/Protocol/ArangoNgramStreamType.cs index 17f976a067..76fb11dc42 100644 --- a/Core.Arango/Protocol/ArangoNgramStreamType.cs +++ b/Core.Arango/Protocol/ArangoNgramStreamType.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoOverwriteMode.cs b/Core.Arango/Protocol/ArangoOverwriteMode.cs index e2a99b1885..70ee3bad27 100644 --- a/Core.Arango/Protocol/ArangoOverwriteMode.cs +++ b/Core.Arango/Protocol/ArangoOverwriteMode.cs @@ -1,6 +1,6 @@ -using System.Runtime.Serialization; +using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Newtonsoft.Json.Converters; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoParseResult.cs b/Core.Arango/Protocol/ArangoParseResult.cs index 917a48ed16..1cd504a562 100644 --- a/Core.Arango/Protocol/ArangoParseResult.cs +++ b/Core.Arango/Protocol/ArangoParseResult.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoPregel.cs b/Core.Arango/Protocol/ArangoPregel.cs index d47518b7f3..42648a8389 100644 --- a/Core.Arango/Protocol/ArangoPregel.cs +++ b/Core.Arango/Protocol/ArangoPregel.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoPregelState.cs b/Core.Arango/Protocol/ArangoPregelState.cs index 2259ced426..ffba30f213 100644 --- a/Core.Arango/Protocol/ArangoPregelState.cs +++ b/Core.Arango/Protocol/ArangoPregelState.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoQueryOptimizer.cs b/Core.Arango/Protocol/ArangoQueryOptimizer.cs index 3c2297e1d7..0b3598ea06 100644 --- a/Core.Arango/Protocol/ArangoQueryOptimizer.cs +++ b/Core.Arango/Protocol/ArangoQueryOptimizer.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoQueryOptions.cs b/Core.Arango/Protocol/ArangoQueryOptions.cs index dda7c7e1ca..6630e98a1e 100644 --- a/Core.Arango/Protocol/ArangoQueryOptions.cs +++ b/Core.Arango/Protocol/ArangoQueryOptions.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoQueryStatistic.cs b/Core.Arango/Protocol/ArangoQueryStatistic.cs index e083b4ea40..fefdc5e4c1 100644 --- a/Core.Arango/Protocol/ArangoQueryStatistic.cs +++ b/Core.Arango/Protocol/ArangoQueryStatistic.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoResponseBase.cs b/Core.Arango/Protocol/ArangoResponseBase.cs index 0d50eb49ec..4d41fbb2d0 100644 --- a/Core.Arango/Protocol/ArangoResponseBase.cs +++ b/Core.Arango/Protocol/ArangoResponseBase.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoSchema.cs b/Core.Arango/Protocol/ArangoSchema.cs index 5acd782c61..f66a9b33f3 100644 --- a/Core.Arango/Protocol/ArangoSchema.cs +++ b/Core.Arango/Protocol/ArangoSchema.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoSchemaLevel.cs b/Core.Arango/Protocol/ArangoSchemaLevel.cs index e123e3cfb1..976c4ee35d 100644 --- a/Core.Arango/Protocol/ArangoSchemaLevel.cs +++ b/Core.Arango/Protocol/ArangoSchemaLevel.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoSort.cs b/Core.Arango/Protocol/ArangoSort.cs index afa0187234..fd3917835a 100644 --- a/Core.Arango/Protocol/ArangoSort.cs +++ b/Core.Arango/Protocol/ArangoSort.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoTransaction.cs b/Core.Arango/Protocol/ArangoTransaction.cs index 71fbb1536f..e8b0f6e231 100644 --- a/Core.Arango/Protocol/ArangoTransaction.cs +++ b/Core.Arango/Protocol/ArangoTransaction.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoTransactionScope.cs b/Core.Arango/Protocol/ArangoTransactionScope.cs index dcb87cddaf..d84039a7ba 100644 --- a/Core.Arango/Protocol/ArangoTransactionScope.cs +++ b/Core.Arango/Protocol/ArangoTransactionScope.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoUpdateResult.cs b/Core.Arango/Protocol/ArangoUpdateResult.cs index 37ca27fc62..c9c24fffd2 100644 --- a/Core.Arango/Protocol/ArangoUpdateResult.cs +++ b/Core.Arango/Protocol/ArangoUpdateResult.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoUser.cs b/Core.Arango/Protocol/ArangoUser.cs index 9deef5a238..be3865ea94 100644 --- a/Core.Arango/Protocol/ArangoUser.cs +++ b/Core.Arango/Protocol/ArangoUser.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoVersion.cs b/Core.Arango/Protocol/ArangoVersion.cs index 45fc50bb2d..2b531439b1 100644 --- a/Core.Arango/Protocol/ArangoVersion.cs +++ b/Core.Arango/Protocol/ArangoVersion.cs @@ -1,6 +1,6 @@ -using System; +using Newtonsoft.Json; +using System; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoVertexCollection.cs b/Core.Arango/Protocol/ArangoVertexCollection.cs index 3b3e360200..bb405acc66 100644 --- a/Core.Arango/Protocol/ArangoVertexCollection.cs +++ b/Core.Arango/Protocol/ArangoVertexCollection.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoVertexResponse.cs b/Core.Arango/Protocol/ArangoVertexResponse.cs index 2099e5de78..88ab8d5e79 100644 --- a/Core.Arango/Protocol/ArangoVertexResponse.cs +++ b/Core.Arango/Protocol/ArangoVertexResponse.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoView.cs b/Core.Arango/Protocol/ArangoView.cs index 7befb227e0..c12e872bd2 100644 --- a/Core.Arango/Protocol/ArangoView.cs +++ b/Core.Arango/Protocol/ArangoView.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoViewCompressionType.cs b/Core.Arango/Protocol/ArangoViewCompressionType.cs index c086918bd1..3aa58ead08 100644 --- a/Core.Arango/Protocol/ArangoViewCompressionType.cs +++ b/Core.Arango/Protocol/ArangoViewCompressionType.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoViewConsolidationPolicy.cs b/Core.Arango/Protocol/ArangoViewConsolidationPolicy.cs index 74d4ef6ab3..7fa3391604 100644 --- a/Core.Arango/Protocol/ArangoViewConsolidationPolicy.cs +++ b/Core.Arango/Protocol/ArangoViewConsolidationPolicy.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { @@ -37,7 +37,7 @@ public class ArangoViewConsolidationPolicy /// Maximum allowed size of all consolidated segments in bytes (default: 5368709120) /// [JsonPropertyName("segmentsBytesMax")] - [JsonProperty(PropertyName = "segmentsBytesMax", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty(PropertyName = "segmentsBytesMax", NullValueHandling = NullValueHandling.Ignore)] [System.Text.Json.Serialization.JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public long? SegmentsBytesMax { get; set; } @@ -45,7 +45,7 @@ public class ArangoViewConsolidationPolicy /// The maximum number of segments that will be evaluated as candidates for consolidation (default: 10) /// [JsonPropertyName("segmentsMax")] - [JsonProperty(PropertyName = "segmentsMax", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty(PropertyName = "segmentsMax", NullValueHandling = NullValueHandling.Ignore)] [System.Text.Json.Serialization.JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public long? SegmentsMax { get; set; } @@ -53,7 +53,7 @@ public class ArangoViewConsolidationPolicy /// The minimum number of segments that will be evaluated as candidates for consolidation (default: 1) /// [JsonPropertyName("segmentsMin")] - [JsonProperty(PropertyName = "segmentsMin", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty(PropertyName = "segmentsMin", NullValueHandling = NullValueHandling.Ignore)] [System.Text.Json.Serialization.JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public long? SegmentsMin { get; set; } diff --git a/Core.Arango/Protocol/ArangoViewConsolidationType.cs b/Core.Arango/Protocol/ArangoViewConsolidationType.cs index 3738c7a977..b2782972b4 100644 --- a/Core.Arango/Protocol/ArangoViewConsolidationType.cs +++ b/Core.Arango/Protocol/ArangoViewConsolidationType.cs @@ -1,7 +1,7 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Core.Arango.Serialization.Json; +using Core.Arango.Serialization.Json; using Newtonsoft.Json.Converters; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoViewInformation.cs b/Core.Arango/Protocol/ArangoViewInformation.cs index f692e14775..3fd01ad6c8 100644 --- a/Core.Arango/Protocol/ArangoViewInformation.cs +++ b/Core.Arango/Protocol/ArangoViewInformation.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol { @@ -27,7 +27,7 @@ public class ArangoViewInformation /// [JsonPropertyName("id")] [JsonProperty(PropertyName = "id")] - public string Id{ get; set; } + public string Id { get; set; } /// /// diff --git a/Core.Arango/Protocol/ArangoViewStoredValue.cs b/Core.Arango/Protocol/ArangoViewStoredValue.cs index fee7ba4cfc..8f062ed041 100644 --- a/Core.Arango/Protocol/ArangoViewStoredValue.cs +++ b/Core.Arango/Protocol/ArangoViewStoredValue.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol { diff --git a/Core.Arango/Protocol/ArangoVoid.cs b/Core.Arango/Protocol/ArangoVoid.cs index b0c04cf0e1..44c32dc435 100644 --- a/Core.Arango/Protocol/ArangoVoid.cs +++ b/Core.Arango/Protocol/ArangoVoid.cs @@ -1,9 +1,8 @@ -namespace Core.Arango.Protocol +namespace Core.Arango.Protocol; + +/// +/// Something to deserialize to when no response needed +/// +public class ArangoVoid { - /// - /// Something to deserialize to when no response needed - /// - public class ArangoVoid - { - } } \ No newline at end of file diff --git a/Core.Arango/Protocol/Internal/BackupList.cs b/Core.Arango/Protocol/Internal/BackupList.cs index d698dd4090..51efbf2250 100644 --- a/Core.Arango/Protocol/Internal/BackupList.cs +++ b/Core.Arango/Protocol/Internal/BackupList.cs @@ -1,6 +1,6 @@ +using Newtonsoft.Json; using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/DocumentCreateResponse.cs b/Core.Arango/Protocol/Internal/DocumentCreateResponse.cs index a02ea7c9e6..bad7cbb22f 100644 --- a/Core.Arango/Protocol/Internal/DocumentCreateResponse.cs +++ b/Core.Arango/Protocol/Internal/DocumentCreateResponse.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/EndpointEntity.cs b/Core.Arango/Protocol/Internal/EndpointEntity.cs index 5ec6ef3d36..41dbd8e924 100644 --- a/Core.Arango/Protocol/Internal/EndpointEntity.cs +++ b/Core.Arango/Protocol/Internal/EndpointEntity.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/EndpointResponse.cs b/Core.Arango/Protocol/Internal/EndpointResponse.cs index d65ce12dbf..25032bb1ac 100644 --- a/Core.Arango/Protocol/Internal/EndpointResponse.cs +++ b/Core.Arango/Protocol/Internal/EndpointResponse.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/ExportRequest.cs b/Core.Arango/Protocol/Internal/ExportRequest.cs index 9da34c56ea..fa03fc6186 100644 --- a/Core.Arango/Protocol/Internal/ExportRequest.cs +++ b/Core.Arango/Protocol/Internal/ExportRequest.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/FunctionRemoveResponse.cs b/Core.Arango/Protocol/Internal/FunctionRemoveResponse.cs index fcf50ce7b2..01faec24fe 100644 --- a/Core.Arango/Protocol/Internal/FunctionRemoveResponse.cs +++ b/Core.Arango/Protocol/Internal/FunctionRemoveResponse.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/GraphResponse.cs b/Core.Arango/Protocol/Internal/GraphResponse.cs index 7310440d21..a59f4e5eb0 100644 --- a/Core.Arango/Protocol/Internal/GraphResponse.cs +++ b/Core.Arango/Protocol/Internal/GraphResponse.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/QueryResponse.cs b/Core.Arango/Protocol/Internal/QueryResponse.cs index 75da5e9940..e680096d22 100644 --- a/Core.Arango/Protocol/Internal/QueryResponse.cs +++ b/Core.Arango/Protocol/Internal/QueryResponse.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/QueryResponseBase.cs b/Core.Arango/Protocol/Internal/QueryResponseBase.cs index b95c3e8a0c..08ddda454c 100644 --- a/Core.Arango/Protocol/Internal/QueryResponseBase.cs +++ b/Core.Arango/Protocol/Internal/QueryResponseBase.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; using System.Text.Json.Serialization; -using Newtonsoft.Json; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/QueryResponseExtra.cs b/Core.Arango/Protocol/Internal/QueryResponseExtra.cs index 880d797817..02c1afa2f6 100644 --- a/Core.Arango/Protocol/Internal/QueryResponseExtra.cs +++ b/Core.Arango/Protocol/Internal/QueryResponseExtra.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/SingleResult.cs b/Core.Arango/Protocol/Internal/SingleResult.cs index 2a702b19eb..a862345b1c 100644 --- a/Core.Arango/Protocol/Internal/SingleResult.cs +++ b/Core.Arango/Protocol/Internal/SingleResult.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Protocol/Internal/TransactionResponse.cs b/Core.Arango/Protocol/Internal/TransactionResponse.cs index 21309a374f..35a99f03c5 100644 --- a/Core.Arango/Protocol/Internal/TransactionResponse.cs +++ b/Core.Arango/Protocol/Internal/TransactionResponse.cs @@ -1,5 +1,5 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Core.Arango.Protocol.Internal { diff --git a/Core.Arango/Relinq/Clauses/AdditionalFromClause.cs b/Core.Arango/Relinq/Clauses/AdditionalFromClause.cs index cf191da2cd..c4a4d89798 100644 --- a/Core.Arango/Relinq/Clauses/AdditionalFromClause.cs +++ b/Core.Arango/Relinq/Clauses/AdditionalFromClause.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses { diff --git a/Core.Arango/Relinq/Clauses/ExpressionVisitors/AccessorFindingExpressionVisitor.cs b/Core.Arango/Relinq/Clauses/ExpressionVisitors/AccessorFindingExpressionVisitor.cs index 1e1839f917..d91d942bce 100644 --- a/Core.Arango/Relinq/Clauses/ExpressionVisitors/AccessorFindingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Clauses/ExpressionVisitors/AccessorFindingExpressionVisitor.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Parsing; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Parsing; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ExpressionVisitors { diff --git a/Core.Arango/Relinq/Clauses/ExpressionVisitors/CloningExpressionVisitor.cs b/Core.Arango/Relinq/Clauses/ExpressionVisitors/CloningExpressionVisitor.cs index 14b93548be..c9bbc35a0a 100644 --- a/Core.Arango/Relinq/Clauses/ExpressionVisitors/CloningExpressionVisitor.cs +++ b/Core.Arango/Relinq/Clauses/ExpressionVisitors/CloningExpressionVisitor.cs @@ -15,10 +15,10 @@ // under the License. // -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ExpressionVisitors { diff --git a/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReferenceReplacingExpressionVisitor.cs b/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReferenceReplacingExpressionVisitor.cs index d21bf909a9..05f5d0e30c 100644 --- a/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReferenceReplacingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReferenceReplacingExpressionVisitor.cs @@ -15,11 +15,11 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ExpressionVisitors { diff --git a/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReverseResolvingExpressionVisitor.cs b/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReverseResolvingExpressionVisitor.cs index edae904e30..1f3dbfd68d 100644 --- a/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReverseResolvingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Clauses/ExpressionVisitors/ReverseResolvingExpressionVisitor.cs @@ -15,14 +15,14 @@ // under the License. // -using System; -using System.Collections.Generic; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ExpressionVisitors { diff --git a/Core.Arango/Relinq/Clauses/Expressions/PartialEvaluationExceptionExpression.cs b/Core.Arango/Relinq/Clauses/Expressions/PartialEvaluationExceptionExpression.cs index bc7529af93..bad5d6ca59 100644 --- a/Core.Arango/Relinq/Clauses/Expressions/PartialEvaluationExceptionExpression.cs +++ b/Core.Arango/Relinq/Clauses/Expressions/PartialEvaluationExceptionExpression.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.Expressions { diff --git a/Core.Arango/Relinq/Clauses/Expressions/QuerySourceReferenceExpression.cs b/Core.Arango/Relinq/Clauses/Expressions/QuerySourceReferenceExpression.cs index b05cf79d53..fe030e0cb9 100644 --- a/Core.Arango/Relinq/Clauses/Expressions/QuerySourceReferenceExpression.cs +++ b/Core.Arango/Relinq/Clauses/Expressions/QuerySourceReferenceExpression.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.Expressions { diff --git a/Core.Arango/Relinq/Clauses/Expressions/SubQueryExpression.cs b/Core.Arango/Relinq/Clauses/Expressions/SubQueryExpression.cs index 823d5b75be..775b15eddd 100644 --- a/Core.Arango/Relinq/Clauses/Expressions/SubQueryExpression.cs +++ b/Core.Arango/Relinq/Clauses/Expressions/SubQueryExpression.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.Expressions { diff --git a/Core.Arango/Relinq/Clauses/Expressions/VBStringComparisonExpression.cs b/Core.Arango/Relinq/Clauses/Expressions/VBStringComparisonExpression.cs index 685c762923..77a211a2e9 100644 --- a/Core.Arango/Relinq/Clauses/Expressions/VBStringComparisonExpression.cs +++ b/Core.Arango/Relinq/Clauses/Expressions/VBStringComparisonExpression.cs @@ -15,11 +15,11 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.Expressions { diff --git a/Core.Arango/Relinq/Clauses/FromClauseBase.cs b/Core.Arango/Relinq/Clauses/FromClauseBase.cs index caddf6dd1a..664ac9422b 100644 --- a/Core.Arango/Relinq/Clauses/FromClauseBase.cs +++ b/Core.Arango/Relinq/Clauses/FromClauseBase.cs @@ -15,11 +15,11 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; #if NET_3_5 using System.Diagnostics; diff --git a/Core.Arango/Relinq/Clauses/GroupJoinClause.cs b/Core.Arango/Relinq/Clauses/GroupJoinClause.cs index 39a00d6f92..52d8953752 100644 --- a/Core.Arango/Relinq/Clauses/GroupJoinClause.cs +++ b/Core.Arango/Relinq/Clauses/GroupJoinClause.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Collections.Generic; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses { diff --git a/Core.Arango/Relinq/Clauses/IFromClause.cs b/Core.Arango/Relinq/Clauses/IFromClause.cs index 8254d359ca..2d7a8cec4a 100644 --- a/Core.Arango/Relinq/Clauses/IFromClause.cs +++ b/Core.Arango/Relinq/Clauses/IFromClause.cs @@ -15,8 +15,8 @@ // under the License. // -using System.Linq.Expressions; using JetBrains.Annotations; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses { diff --git a/Core.Arango/Relinq/Clauses/IQuerySource.cs b/Core.Arango/Relinq/Clauses/IQuerySource.cs index 7d96b293db..7ef69baf51 100644 --- a/Core.Arango/Relinq/Clauses/IQuerySource.cs +++ b/Core.Arango/Relinq/Clauses/IQuerySource.cs @@ -15,8 +15,8 @@ // under the License. // -using System; using Core.Arango.Relinq.Clauses.Expressions; +using System; namespace Core.Arango.Relinq.Clauses { diff --git a/Core.Arango/Relinq/Clauses/JoinClause.cs b/Core.Arango/Relinq/Clauses/JoinClause.cs index 9efee747dc..ee9895f062 100644 --- a/Core.Arango/Relinq/Clauses/JoinClause.cs +++ b/Core.Arango/Relinq/Clauses/JoinClause.cs @@ -15,11 +15,11 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; #if NET_3_5 using System.Diagnostics; diff --git a/Core.Arango/Relinq/Clauses/MainFromClause.cs b/Core.Arango/Relinq/Clauses/MainFromClause.cs index 0f4cd4772f..553d8bc476 100644 --- a/Core.Arango/Relinq/Clauses/MainFromClause.cs +++ b/Core.Arango/Relinq/Clauses/MainFromClause.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses { diff --git a/Core.Arango/Relinq/Clauses/OrderByClause.cs b/Core.Arango/Relinq/Clauses/OrderByClause.cs index e72408cb9a..caeb60b63b 100644 --- a/Core.Arango/Relinq/Clauses/OrderByClause.cs +++ b/Core.Arango/Relinq/Clauses/OrderByClause.cs @@ -15,12 +15,12 @@ // under the License. // +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq.Expressions; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; #if !NET_3_5 diff --git a/Core.Arango/Relinq/Clauses/Ordering.cs b/Core.Arango/Relinq/Clauses/Ordering.cs index b1a9cd675c..d38db07ef6 100644 --- a/Core.Arango/Relinq/Clauses/Ordering.cs +++ b/Core.Arango/Relinq/Clauses/Ordering.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; #if NET_3_5 using System.Diagnostics; diff --git a/Core.Arango/Relinq/Clauses/QuerySourceMapping.cs b/Core.Arango/Relinq/Clauses/QuerySourceMapping.cs index 1d95fdd872..6d7e9d4790 100644 --- a/Core.Arango/Relinq/Clauses/QuerySourceMapping.cs +++ b/Core.Arango/Relinq/Clauses/QuerySourceMapping.cs @@ -15,11 +15,11 @@ // under the License. // +using Core.Arango.Relinq.Clauses.ExpressionVisitors; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.ExpressionVisitors; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses { diff --git a/Core.Arango/Relinq/Clauses/ResultOperatorBase.cs b/Core.Arango/Relinq/Clauses/ResultOperatorBase.cs index 7948b7f088..0b8de6dd38 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperatorBase.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperatorBase.cs @@ -15,13 +15,13 @@ // under the License. // -using System; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Clauses { @@ -115,7 +115,7 @@ protected object InvokeExecuteMethod(MethodInfo method, object input) var targetObject = method.IsStatic ? null : this; try { - return method.Invoke(targetObject, new[] {input}); + return method.Invoke(targetObject, new[] { input }); } catch (TargetInvocationException ex) { @@ -162,7 +162,7 @@ protected T GetConstantValueFromExpression(string expressionName, Expression var itemAsConstantExpression = expression as ConstantExpression; if (itemAsConstantExpression != null) { - return (T) itemAsConstantExpression.Value; + return (T)itemAsConstantExpression.Value; } { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/AggregateFromSeedResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/AggregateFromSeedResultOperator.cs index f71ab002b4..53d626cefb 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/AggregateFromSeedResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/AggregateFromSeedResultOperator.cs @@ -15,16 +15,16 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Clauses.ExpressionVisitors; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using JetBrains.Annotations; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -44,7 +44,7 @@ internal sealed class AggregateFromSeedResultOperator : ValueFromSequenceResultO { private static readonly MethodInfo s_executeMethod = typeof(AggregateFromSeedResultOperator).GetRuntimeMethodChecked("ExecuteAggregateInMemory", - new[] {typeof(StreamedSequence)}); + new[] { typeof(StreamedSequence) }); private LambdaExpression _func; private LambdaExpression _resultSelector; @@ -166,7 +166,7 @@ public override StreamedValue ExecuteInMemory(StreamedSequence input) ArgumentUtility.CheckNotNull("input", input); var closedExecuteMethod = s_executeMethod.MakeGenericMethod(typeof(TInput), Seed.Type, GetResultType()); - return (StreamedValue) InvokeExecuteMethod(closedExecuteMethod, input); + return (StreamedValue)InvokeExecuteMethod(closedExecuteMethod, input); } /// @@ -185,7 +185,7 @@ public StreamedValue ExecuteAggregateInMemory(Strea var seed = GetConstantSeed(); var funcLambda = ReverseResolvingExpressionVisitor.ReverseResolveLambda(input.DataInfo.ItemExpression, Func, 1); - var func = (Func) funcLambda.Compile(); + var func = (Func)funcLambda.Compile(); var aggregated = sequence.Aggregate(seed, func); var outputDataInfo = GetOutputDataInfo(input.DataInfo); @@ -194,7 +194,7 @@ public StreamedValue ExecuteAggregateInMemory(Strea return new StreamedValue(aggregated, outputDataInfo); } - var resultSelector = (Func) OptionalResultSelector.Compile(); + var resultSelector = (Func)OptionalResultSelector.Compile(); var result = resultSelector(aggregated); return new StreamedValue(result, outputDataInfo); } @@ -249,9 +249,9 @@ private StreamedValueInfo GetOutputDataInfo([NotNull] StreamedSequenceInfo seque public override void TransformExpressions(Func transformation) { Seed = transformation(Seed); - Func = (LambdaExpression) transformation(Func); + Func = (LambdaExpression)transformation(Func); if (OptionalResultSelector != null) - OptionalResultSelector = (LambdaExpression) transformation(OptionalResultSelector); + OptionalResultSelector = (LambdaExpression)transformation(OptionalResultSelector); } /// diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/AggregateResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/AggregateResultOperator.cs index e2b76cad87..7fbb420823 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/AggregateResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/AggregateResultOperator.cs @@ -15,16 +15,16 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Clauses.ExpressionVisitors; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using JetBrains.Annotations; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -103,7 +103,7 @@ public override StreamedValue ExecuteInMemory(StreamedSequence input) var sequence = input.GetTypedSequence(); var funcLambda = ReverseResolvingExpressionVisitor.ReverseResolveLambda(input.DataInfo.ItemExpression, Func, 1); - var func = (Func) funcLambda.Compile(); + var func = (Func)funcLambda.Compile(); var result = sequence.Aggregate(func); return new StreamedValue(result, GetOutputDataInfo(input.DataInfo)); } @@ -133,7 +133,7 @@ private StreamedValueInfo GetOutputDataInfo([NotNull] StreamedSequenceInfo seque public override void TransformExpressions(Func transformation) { ArgumentUtility.CheckNotNull("transformation", transformation); - Func = (LambdaExpression) transformation(Func); + Func = (LambdaExpression)transformation(Func); } /// diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/AllResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/AllResultOperator.cs index 35ebdb29bc..d69e7ad325 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/AllResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/AllResultOperator.cs @@ -15,14 +15,14 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.ExpressionVisitors; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using JetBrains.Annotations; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -76,7 +76,7 @@ public override StreamedValue ExecuteInMemory(StreamedSequence input) var predicateLambda = ReverseResolvingExpressionVisitor.ReverseResolve(input.DataInfo.ItemExpression, Predicate); - var predicate = (Func) predicateLambda.Compile(); + var predicate = (Func)predicateLambda.Compile(); var result = sequence.All(predicate); return new StreamedValue(result, GetOutputDataInfo(input.DataInfo)); diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/AnyResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/AnyResultOperator.cs index 74b43a3ed5..a08a8e8f1b 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/AnyResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/AnyResultOperator.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.StreamedData; using JetBrains.Annotations; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/AsQueryableResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/AsQueryableResultOperator.cs index f45bfec789..1d3728ad7b 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/AsQueryableResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/AsQueryableResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/AverageResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/AverageResultOperator.cs index db468112e8..2bf5cf4315 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/AverageResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/AverageResultOperator.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; +using JetBrains.Annotations; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses.StreamedData; -using JetBrains.Annotations; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -48,7 +48,7 @@ public override StreamedValue ExecuteInMemory(StreamedSequence input) { ArgumentUtility.CheckNotNull("input", input); - var method = typeof(Enumerable).GetRuntimeMethod("Average", new[] {typeof(IEnumerable)}); + var method = typeof(Enumerable).GetRuntimeMethod("Average", new[] { typeof(IEnumerable) }); if (method == null) { var message = string.Format("Cannot calculate the average of objects of type '{0}' in memory.", @@ -59,7 +59,7 @@ public override StreamedValue ExecuteInMemory(StreamedSequence input) Assertion.DebugAssert(GetOutputDataInfo(input.DataInfo).DataType == method.ReturnType, "ReturnType of method matches return type of this operator"); - var result = method.Invoke(null, new[] {input.GetTypedSequence()}); + var result = method.Invoke(null, new[] { input.GetTypedSequence() }); return new StreamedValue(result, GetOutputDataInfo(input.DataInfo)); } diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/CastResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/CastResultOperator.cs index 77c68837db..126db501a9 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/CastResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/CastResultOperator.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses.StreamedData; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -40,7 +40,7 @@ namespace Core.Arango.Relinq.Clauses.ResultOperators internal sealed class CastResultOperator : SequenceFromSequenceResultOperatorBase { private static readonly MethodInfo s_enumerableCastMethod = - typeof(Enumerable).GetRuntimeMethodChecked("Cast", new[] {typeof(IEnumerable)}); + typeof(Enumerable).GetRuntimeMethodChecked("Cast", new[] { typeof(IEnumerable) }); private Type _castItemType; @@ -71,8 +71,8 @@ public override StreamedSequence ExecuteInMemory(StreamedSequence input) var sequence = input.GetTypedSequence(); var castMethod = s_enumerableCastMethod.MakeGenericMethod(CastItemType); - var result = (IEnumerable) InvokeExecuteMethod(castMethod, sequence); - return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo) GetOutputDataInfo(input.DataInfo)); + var result = (IEnumerable)InvokeExecuteMethod(castMethod, sequence); + return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo)GetOutputDataInfo(input.DataInfo)); } public override IStreamedDataInfo GetOutputDataInfo(IStreamedDataInfo inputInfo) diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/ConcatResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/ConcatResultOperator.cs index 40816708f1..22d78f8547 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/ConcatResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/ConcatResultOperator.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses.Expressions; +using Core.Arango.Relinq.Clauses.StreamedData; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -99,8 +99,8 @@ public override ResultOperatorBase Clone(CloneContext cloneContext) public override StreamedSequence ExecuteInMemory(StreamedSequence input) { var sequence = input.GetTypedSequence(); - var result = sequence.Concat((IEnumerable) GetConstantSource2()); - return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo) GetOutputDataInfo(input.DataInfo)); + var result = sequence.Concat((IEnumerable)GetConstantSource2()); + return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo)GetOutputDataInfo(input.DataInfo)); } public override IStreamedDataInfo GetOutputDataInfo(IStreamedDataInfo inputInfo) diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/ContainsResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/ContainsResultOperator.cs index e3b65c75d0..106196e19e 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/ContainsResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/ContainsResultOperator.cs @@ -15,14 +15,14 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using JetBrains.Annotations; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/CountResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/CountResultOperator.cs index b71f393704..a7600a6198 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/CountResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/CountResultOperator.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.StreamedData; using JetBrains.Annotations; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/DefaultIfEmptyResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/DefaultIfEmptyResultOperator.cs index afe29e9fcb..cd91b82ae5 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/DefaultIfEmptyResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/DefaultIfEmptyResultOperator.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -74,7 +74,7 @@ public override StreamedSequence ExecuteInMemory(StreamedSequence input) var sequence = input.GetTypedSequence(); var result = OptionalDefaultValue != null - ? sequence.DefaultIfEmpty((T) GetConstantOptionalDefaultValue()) + ? sequence.DefaultIfEmpty((T)GetConstantOptionalDefaultValue()) : sequence.DefaultIfEmpty(); return new StreamedSequence(result.AsQueryable(), GetOutputDataInfo(input.DataInfo)); } diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/DistinctResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/DistinctResultOperator.cs index 85bd4fdcf6..f2a94050da 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/DistinctResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/DistinctResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/ExceptResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/ExceptResultOperator.cs index ff6073b5cd..20f9de07a8 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/ExceptResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/ExceptResultOperator.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/FirstResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/FirstResultOperator.cs index dc1330be29..1c7ffdb697 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/FirstResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/FirstResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/GroupResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/GroupResultOperator.cs index 1dfe8eaf53..d6430c0e69 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/GroupResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/GroupResultOperator.cs @@ -15,15 +15,15 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Clauses.ExpressionVisitors; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -49,7 +49,7 @@ internal sealed class GroupResultOperator : SequenceFromSequenceResultOperatorBa { private static readonly MethodInfo s_executeMethod = typeof(GroupResultOperator).GetRuntimeMethodChecked("ExecuteGroupingInMemory", - new[] {typeof(StreamedSequence)}); + new[] { typeof(StreamedSequence) }); private Expression _elementSelector; @@ -170,7 +170,7 @@ public override StreamedSequence ExecuteInMemory(StreamedSequence input) var closedExecuteMethod = s_executeMethod.MakeGenericMethod(typeof(TInput), KeySelector.Type, ElementSelector.Type); - return (StreamedSequence) InvokeExecuteMethod(closedExecuteMethod, input); + return (StreamedSequence)InvokeExecuteMethod(closedExecuteMethod, input); } public StreamedSequence ExecuteGroupingInMemory(StreamedSequence input) @@ -181,15 +181,15 @@ public StreamedSequence ExecuteGroupingInMemory(Streame var keySelectorLambda = ReverseResolvingExpressionVisitor.ReverseResolve(input.DataInfo.ItemExpression, KeySelector); - var keySelector = (Func) keySelectorLambda.Compile(); + var keySelector = (Func)keySelectorLambda.Compile(); var elementSelectorLambda = ReverseResolvingExpressionVisitor.ReverseResolve(input.DataInfo.ItemExpression, ElementSelector); - var elementSelector = (Func) elementSelectorLambda.Compile(); + var elementSelector = (Func)elementSelectorLambda.Compile(); var resultSequence = inputSequence.GroupBy(keySelector, elementSelector); return new StreamedSequence(resultSequence.AsQueryable(), - (StreamedSequenceInfo) GetOutputDataInfo(input.DataInfo)); + (StreamedSequenceInfo)GetOutputDataInfo(input.DataInfo)); } public override IStreamedDataInfo GetOutputDataInfo(IStreamedDataInfo inputInfo) diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/IntersectResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/IntersectResultOperator.cs index 37ce3bda03..ba4dc89fec 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/IntersectResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/IntersectResultOperator.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/LastResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/LastResultOperator.cs index fc4ea4b44f..3ff3d9cf1a 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/LastResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/LastResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/LongCountResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/LongCountResultOperator.cs index b337f54be0..e59b2f341b 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/LongCountResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/LongCountResultOperator.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.StreamedData; using JetBrains.Annotations; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/MaxResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/MaxResultOperator.cs index 90269edb9c..95548bc029 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/MaxResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/MaxResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/MinResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/MinResultOperator.cs index 472ba6d9eb..ea45709517 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/MinResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/MinResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/OfTypeResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/OfTypeResultOperator.cs index c0c4d3d55c..2649cd77a5 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/OfTypeResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/OfTypeResultOperator.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses.StreamedData; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -40,7 +40,7 @@ namespace Core.Arango.Relinq.Clauses.ResultOperators internal sealed class OfTypeResultOperator : SequenceFromSequenceResultOperatorBase { private static readonly MethodInfo s_enumerableOfTypeMethod = - typeof(Enumerable).GetRuntimeMethodChecked("OfType", new[] {typeof(IEnumerable)}); + typeof(Enumerable).GetRuntimeMethodChecked("OfType", new[] { typeof(IEnumerable) }); private Type _searchedItemType; @@ -69,8 +69,8 @@ public override StreamedSequence ExecuteInMemory(StreamedSequence input) { var sequence = input.GetTypedSequence(); var castMethod = s_enumerableOfTypeMethod.MakeGenericMethod(SearchedItemType); - var result = (IEnumerable) InvokeExecuteMethod(castMethod, sequence); - return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo) GetOutputDataInfo(input.DataInfo)); + var result = (IEnumerable)InvokeExecuteMethod(castMethod, sequence); + return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo)GetOutputDataInfo(input.DataInfo)); } public override IStreamedDataInfo GetOutputDataInfo(IStreamedDataInfo inputInfo) diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/ReverseResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/ReverseResultOperator.cs index e4e996c0ee..ffd17deb0a 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/ReverseResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/ReverseResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/SequenceFromSequenceResultOperatorBase.cs b/Core.Arango/Relinq/Clauses/ResultOperators/SequenceFromSequenceResultOperatorBase.cs index 1acd17d3f0..c24b87d629 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/SequenceFromSequenceResultOperatorBase.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/SequenceFromSequenceResultOperatorBase.cs @@ -15,10 +15,10 @@ // under the License. // -using System.Reflection; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -30,7 +30,7 @@ internal abstract class SequenceFromSequenceResultOperatorBase : ResultOperatorB { private static readonly MethodInfo s_executeMethod = typeof(SequenceFromSequenceResultOperatorBase).GetRuntimeMethodChecked("ExecuteInMemory", - new[] {typeof(StreamedSequence)}); + new[] { typeof(StreamedSequence) }); public abstract StreamedSequence ExecuteInMemory(StreamedSequence input); @@ -39,7 +39,7 @@ public sealed override IStreamedData ExecuteInMemory(IStreamedData input) var sequenceInput = ArgumentUtility.CheckNotNullAndType("input", input); var executeMethod = s_executeMethod.MakeGenericMethod(sequenceInput.DataInfo.ResultItemType); - return (StreamedSequence) InvokeExecuteMethod(executeMethod, sequenceInput); + return (StreamedSequence)InvokeExecuteMethod(executeMethod, sequenceInput); } } } \ No newline at end of file diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/SequenceTypePreservingResultOperatorBase.cs b/Core.Arango/Relinq/Clauses/ResultOperators/SequenceTypePreservingResultOperatorBase.cs index 876d366635..03a91b0a39 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/SequenceTypePreservingResultOperatorBase.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/SequenceTypePreservingResultOperatorBase.cs @@ -15,9 +15,9 @@ // under the License. // -using System.Linq; using Core.Arango.Relinq.Clauses.StreamedData; using Remotion.Utilities; +using System.Linq; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/SingleResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/SingleResultOperator.cs index 70d21e849f..14864f19bd 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/SingleResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/SingleResultOperator.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; using System; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/SkipResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/SkipResultOperator.cs index e10c9046d6..76577d6904 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/SkipResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/SkipResultOperator.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/SumResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/SumResultOperator.cs index dd7be2e1b6..1824029bdb 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/SumResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/SumResultOperator.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses.StreamedData; +using JetBrains.Annotations; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses.StreamedData; -using JetBrains.Annotations; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -48,7 +48,7 @@ public override StreamedValue ExecuteInMemory(StreamedSequence input) { ArgumentUtility.CheckNotNull("input", input); - var method = typeof(Enumerable).GetRuntimeMethod("Sum", new[] {typeof(IEnumerable)}); + var method = typeof(Enumerable).GetRuntimeMethod("Sum", new[] { typeof(IEnumerable) }); if (method == null) { var message = string.Format("Cannot calculate the sum of objects of type '{0}' in memory.", @@ -56,8 +56,8 @@ public override StreamedValue ExecuteInMemory(StreamedSequence input) throw new NotSupportedException(message); } - var result = method.Invoke(null, new[] {input.GetTypedSequence()}); - return new StreamedValue(result, (StreamedValueInfo) GetOutputDataInfo(input.DataInfo)); + var result = method.Invoke(null, new[] { input.GetTypedSequence() }); + return new StreamedValue(result, (StreamedValueInfo)GetOutputDataInfo(input.DataInfo)); } public override IStreamedDataInfo GetOutputDataInfo(IStreamedDataInfo inputInfo) diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/TakeResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/TakeResultOperator.cs index 908ac9f48e..cd0078513f 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/TakeResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/TakeResultOperator.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Clauses.ResultOperators { diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/UnionResultOperator.cs b/Core.Arango/Relinq/Clauses/ResultOperators/UnionResultOperator.cs index d7d472d987..6abe897b93 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/UnionResultOperator.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/UnionResultOperator.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses.Expressions; +using Core.Arango.Relinq.Clauses.StreamedData; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Clauses.Expressions; -using Core.Arango.Relinq.Clauses.StreamedData; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -97,8 +97,8 @@ public override ResultOperatorBase Clone(CloneContext cloneContext) public override StreamedSequence ExecuteInMemory(StreamedSequence input) { var sequence = input.GetTypedSequence(); - var result = sequence.Union((IEnumerable) GetConstantSource2()); - return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo) GetOutputDataInfo(input.DataInfo)); + var result = sequence.Union((IEnumerable)GetConstantSource2()); + return new StreamedSequence(result.AsQueryable(), (StreamedSequenceInfo)GetOutputDataInfo(input.DataInfo)); } public override IStreamedDataInfo GetOutputDataInfo(IStreamedDataInfo inputInfo) diff --git a/Core.Arango/Relinq/Clauses/ResultOperators/ValueFromSequenceResultOperatorBase.cs b/Core.Arango/Relinq/Clauses/ResultOperators/ValueFromSequenceResultOperatorBase.cs index 3ee15789c4..65e99cd06a 100644 --- a/Core.Arango/Relinq/Clauses/ResultOperators/ValueFromSequenceResultOperatorBase.cs +++ b/Core.Arango/Relinq/Clauses/ResultOperators/ValueFromSequenceResultOperatorBase.cs @@ -15,10 +15,10 @@ // under the License. // -using System.Reflection; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.ResultOperators { @@ -30,7 +30,7 @@ internal abstract class ValueFromSequenceResultOperatorBase : ResultOperatorBase { private static readonly MethodInfo s_executeMethod = typeof(ValueFromSequenceResultOperatorBase).GetRuntimeMethodChecked("ExecuteInMemory", - new[] {typeof(StreamedSequence)}); + new[] { typeof(StreamedSequence) }); public abstract StreamedValue ExecuteInMemory(StreamedSequence sequence); @@ -39,7 +39,7 @@ public sealed override IStreamedData ExecuteInMemory(IStreamedData input) var sequenceInput = ArgumentUtility.CheckNotNullAndType("input", input); var executeMethod = s_executeMethod.MakeGenericMethod(sequenceInput.DataInfo.ResultItemType); - return (StreamedValue) InvokeExecuteMethod(executeMethod, sequenceInput); + return (StreamedValue)InvokeExecuteMethod(executeMethod, sequenceInput); } } } \ No newline at end of file diff --git a/Core.Arango/Relinq/Clauses/SelectClause.cs b/Core.Arango/Relinq/Clauses/SelectClause.cs index f8959bd189..481fb60d2a 100644 --- a/Core.Arango/Relinq/Clauses/SelectClause.cs +++ b/Core.Arango/Relinq/Clauses/SelectClause.cs @@ -15,13 +15,13 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; #if NET_3_5 using System.Diagnostics; diff --git a/Core.Arango/Relinq/Clauses/StreamedData/StreamedScalarValueInfo.cs b/Core.Arango/Relinq/Clauses/StreamedData/StreamedScalarValueInfo.cs index cb00b0f85c..de18ddf9cd 100644 --- a/Core.Arango/Relinq/Clauses/StreamedData/StreamedScalarValueInfo.cs +++ b/Core.Arango/Relinq/Clauses/StreamedData/StreamedScalarValueInfo.cs @@ -15,11 +15,11 @@ // under the License. // -using System; -using System.Reflection; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.StreamedData { @@ -33,7 +33,7 @@ internal sealed class StreamedScalarValueInfo : StreamedValueInfo { private static readonly MethodInfo s_executeMethod = typeof(StreamedScalarValueInfo).GetRuntimeMethodChecked("ExecuteScalarQueryModel", - new[] {typeof(QueryModel), typeof(IQueryExecutor)}); + new[] { typeof(QueryModel), typeof(IQueryExecutor) }); public StreamedScalarValueInfo(Type dataType) : base(dataType) @@ -48,7 +48,7 @@ public override IStreamedData ExecuteQueryModel(QueryModel queryModel, IQueryExe var executeMethod = s_executeMethod.MakeGenericMethod(DataType); // wrap executeMethod into a delegate instead of calling Invoke in order to allow for exceptions that are bubbled up correctly - var func = (Func) executeMethod.CreateDelegate( + var func = (Func)executeMethod.CreateDelegate( typeof(Func), this); var result = func(queryModel, executor); diff --git a/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequence.cs b/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequence.cs index b775597c0f..a115129710 100644 --- a/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequence.cs +++ b/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequence.cs @@ -15,12 +15,12 @@ // under the License. // +using JetBrains.Annotations; +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Linq.Expressions; -using JetBrains.Annotations; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.StreamedData { @@ -79,7 +79,7 @@ public IEnumerable GetTypedSequence() { try { - return (IEnumerable) Sequence; + return (IEnumerable)Sequence; } catch (InvalidCastException ex) { diff --git a/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequenceInfo.cs b/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequenceInfo.cs index 68a6c3a549..0adada4457 100644 --- a/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequenceInfo.cs +++ b/Core.Arango/Relinq/Clauses/StreamedData/StreamedSequenceInfo.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.StreamedData { @@ -35,7 +35,7 @@ internal sealed class StreamedSequenceInfo : IStreamedDataInfo { private static readonly MethodInfo s_executeMethod = typeof(StreamedSequenceInfo).GetRuntimeMethodChecked("ExecuteCollectionQueryModel", - new[] {typeof(QueryModel), typeof(IQueryExecutor)}); + new[] { typeof(QueryModel), typeof(IQueryExecutor) }); public StreamedSequenceInfo(Type dataType, Expression itemExpression) { @@ -139,7 +139,7 @@ public IStreamedData ExecuteQueryModel(QueryModel queryModel, IQueryExecutor exe // wrap executeMethod into a delegate instead of calling Invoke in order to allow for exceptions that are bubbled up correctly var func = - (Func) executeMethod.CreateDelegate( + (Func)executeMethod.CreateDelegate( typeof(Func), this); var result = func(queryModel, executor).AsQueryable(); @@ -154,7 +154,7 @@ public bool Equals(IStreamedDataInfo obj) if (GetType() != obj.GetType()) return false; - var other = (StreamedSequenceInfo) obj; + var other = (StreamedSequenceInfo)obj; return DataType.Equals(other.DataType) && ItemExpression.Equals(other.ItemExpression); } diff --git a/Core.Arango/Relinq/Clauses/StreamedData/StreamedSingleValueInfo.cs b/Core.Arango/Relinq/Clauses/StreamedData/StreamedSingleValueInfo.cs index d95ab62f67..b7104eecb4 100644 --- a/Core.Arango/Relinq/Clauses/StreamedData/StreamedSingleValueInfo.cs +++ b/Core.Arango/Relinq/Clauses/StreamedData/StreamedSingleValueInfo.cs @@ -15,11 +15,11 @@ // under the License. // -using System; -using System.Reflection; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Reflection; namespace Core.Arango.Relinq.Clauses.StreamedData { @@ -33,7 +33,7 @@ internal sealed class StreamedSingleValueInfo : StreamedValueInfo { private static readonly MethodInfo s_executeMethod = typeof(StreamedSingleValueInfo).GetRuntimeMethodChecked("ExecuteSingleQueryModel", - new[] {typeof(QueryModel), typeof(IQueryExecutor)}); + new[] { typeof(QueryModel), typeof(IQueryExecutor) }); public StreamedSingleValueInfo(Type dataType, bool returnDefaultWhenEmpty) : base(dataType) @@ -50,7 +50,7 @@ public override IStreamedData ExecuteQueryModel(QueryModel queryModel, IQueryExe var executeMethod = s_executeMethod.MakeGenericMethod(DataType); // wrap executeMethod into a delegate instead of calling Invoke in order to allow for exceptions that are bubbled up correctly - var func = (Func) executeMethod.CreateDelegate( + var func = (Func)executeMethod.CreateDelegate( typeof(Func), this); var result = func(queryModel, executor); @@ -72,7 +72,7 @@ public object ExecuteSingleQueryModel(QueryModel queryModel, IQueryExecutor e public override bool Equals(IStreamedDataInfo obj) { - return base.Equals(obj) && ((StreamedSingleValueInfo) obj).ReturnDefaultWhenEmpty == ReturnDefaultWhenEmpty; + return base.Equals(obj) && ((StreamedSingleValueInfo)obj).ReturnDefaultWhenEmpty == ReturnDefaultWhenEmpty; } public override int GetHashCode() diff --git a/Core.Arango/Relinq/Clauses/StreamedData/StreamedValue.cs b/Core.Arango/Relinq/Clauses/StreamedData/StreamedValue.cs index c2242a3b68..2a1d04bf8d 100644 --- a/Core.Arango/Relinq/Clauses/StreamedData/StreamedValue.cs +++ b/Core.Arango/Relinq/Clauses/StreamedData/StreamedValue.cs @@ -15,8 +15,8 @@ // under the License. // -using System; using Remotion.Utilities; +using System; namespace Core.Arango.Relinq.Clauses.StreamedData { @@ -72,7 +72,7 @@ public T GetTypedValue() { try { - return (T) Value; + return (T)Value; } catch (InvalidCastException ex) { diff --git a/Core.Arango/Relinq/Clauses/StreamedData/StreamedValueInfo.cs b/Core.Arango/Relinq/Clauses/StreamedData/StreamedValueInfo.cs index d2295d5c72..9f64c89eb3 100644 --- a/Core.Arango/Relinq/Clauses/StreamedData/StreamedValueInfo.cs +++ b/Core.Arango/Relinq/Clauses/StreamedData/StreamedValueInfo.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Clauses.StreamedData { @@ -66,7 +66,7 @@ public virtual bool Equals(IStreamedDataInfo obj) if (GetType() != obj.GetType()) return false; - var other = (StreamedValueInfo) obj; + var other = (StreamedValueInfo)obj; return DataType.Equals(other.DataType); } diff --git a/Core.Arango/Relinq/Clauses/WhereClause.cs b/Core.Arango/Relinq/Clauses/WhereClause.cs index e5429ca31c..fbe5518c82 100644 --- a/Core.Arango/Relinq/Clauses/WhereClause.cs +++ b/Core.Arango/Relinq/Clauses/WhereClause.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; #if NET_3_5 using System.Diagnostics; diff --git a/Core.Arango/Relinq/Collections/ChangeResistantObservableCollectionEnumerator.cs b/Core.Arango/Relinq/Collections/ChangeResistantObservableCollectionEnumerator.cs index 29e15446c7..54611ce43b 100644 --- a/Core.Arango/Relinq/Collections/ChangeResistantObservableCollectionEnumerator.cs +++ b/Core.Arango/Relinq/Collections/ChangeResistantObservableCollectionEnumerator.cs @@ -15,12 +15,12 @@ // under the License. // +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; -using Remotion.Utilities; #if !NET_3_5 #endif diff --git a/Core.Arango/Relinq/Collections/IndexValuePair.cs b/Core.Arango/Relinq/Collections/IndexValuePair.cs index 8964cdad29..08737c0bd8 100644 --- a/Core.Arango/Relinq/Collections/IndexValuePair.cs +++ b/Core.Arango/Relinq/Collections/IndexValuePair.cs @@ -15,8 +15,8 @@ // under the License. // -using System; using Remotion.Utilities; +using System; namespace Core.Arango.Relinq.Collections { diff --git a/Core.Arango/Relinq/Collections/MultiDictionaryExtensions.cs b/Core.Arango/Relinq/Collections/MultiDictionaryExtensions.cs index 0b887cf759..03f308ea78 100644 --- a/Core.Arango/Relinq/Collections/MultiDictionaryExtensions.cs +++ b/Core.Arango/Relinq/Collections/MultiDictionaryExtensions.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System.Collections.Generic; using System.Linq; -using Remotion.Utilities; namespace Core.Arango.Relinq.Collections { diff --git a/Core.Arango/Relinq/Collections/ObservableCollectionExtensions.cs b/Core.Arango/Relinq/Collections/ObservableCollectionExtensions.cs index c847b3c007..9c0a1fce66 100644 --- a/Core.Arango/Relinq/Collections/ObservableCollectionExtensions.cs +++ b/Core.Arango/Relinq/Collections/ObservableCollectionExtensions.cs @@ -15,10 +15,10 @@ // under the License. // +using Remotion.Utilities; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using Remotion.Utilities; #if !NET_3_5 #endif @@ -53,7 +53,7 @@ public static IEnumerable> AsChangeResistantEnumerableWithInde this ObservableCollection collection) { using (var enumerator = - (ChangeResistantObservableCollectionEnumerator) collection.AsChangeResistantEnumerable() + (ChangeResistantObservableCollectionEnumerator)collection.AsChangeResistantEnumerable() .GetEnumerator()) { while (enumerator.MoveNext()) diff --git a/Core.Arango/Relinq/DefaultQueryProvider.cs b/Core.Arango/Relinq/DefaultQueryProvider.cs index d478924d01..ec09aa573d 100644 --- a/Core.Arango/Relinq/DefaultQueryProvider.cs +++ b/Core.Arango/Relinq/DefaultQueryProvider.cs @@ -15,12 +15,12 @@ // under the License. // +using Core.Arango.Relinq.Parsing.Structure; +using Remotion.Utilities; using System; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Parsing.Structure; -using Remotion.Utilities; namespace Core.Arango.Relinq { @@ -103,7 +103,7 @@ private void CheckQueryableType(Type queryableType) /// An that represents the query defined by . public override IQueryable CreateQuery(Expression expression) { - return (IQueryable) Activator.CreateInstance(QueryableType.MakeGenericType(typeof(T)), this, expression); + return (IQueryable)Activator.CreateInstance(QueryableType.MakeGenericType(typeof(T)), this, expression); } } } \ No newline at end of file diff --git a/Core.Arango/Relinq/IQueryExecutor.cs b/Core.Arango/Relinq/IQueryExecutor.cs index 9301504191..5b8a36b9ef 100644 --- a/Core.Arango/Relinq/IQueryExecutor.cs +++ b/Core.Arango/Relinq/IQueryExecutor.cs @@ -15,9 +15,9 @@ // under the License. // +using Core.Arango.Relinq.Clauses.ResultOperators; using System; using System.Collections.Generic; -using Core.Arango.Relinq.Clauses.ResultOperators; namespace Core.Arango.Relinq { diff --git a/Core.Arango/Relinq/Packages/ArgumentUtility.cs b/Core.Arango/Relinq/Packages/ArgumentUtility.cs index ed5185e2a5..797abd3f84 100644 --- a/Core.Arango/Relinq/Packages/ArgumentUtility.cs +++ b/Core.Arango/Relinq/Packages/ArgumentUtility.cs @@ -15,11 +15,11 @@ // under the License. // +using JetBrains.Annotations; using System; using System.Collections; using System.Diagnostics; using System.Reflection; -using JetBrains.Annotations; // ReSharper disable once CheckNamespace namespace Remotion.Utilities @@ -175,7 +175,7 @@ public static T CheckNotEmpty([InvokerParameterName] string argumentName, T e { // ReSharper disable CompareNonConstrainedGenericWithNull if (enumerable != null) - // ReSharper restore CompareNonConstrainedGenericWithNull + // ReSharper restore CompareNonConstrainedGenericWithNull { var collection = enumerable as ICollection; if (collection != null) @@ -243,14 +243,14 @@ public static TExpected CheckNotNullAndType( [InvokerParameterName] string argumentName, [AssertionCondition(AssertionConditionType.IS_NOT_NULL)] [NoEnumeration] object actualValue) - // where TExpected: struct + // where TExpected: struct { if (actualValue == null) throw new ArgumentNullException(argumentName); if (!(actualValue is TExpected)) throw CreateArgumentTypeException(argumentName, actualValue.GetType(), typeof(TExpected)); - return (TExpected) actualValue; + return (TExpected)actualValue; } /// Checks of the is of the . @@ -304,7 +304,7 @@ public static TExpected CheckType([InvokerParameterName] string argum if (actualValue == null) try { - return (TExpected) actualValue; + return (TExpected)actualValue; } catch (NullReferenceException) { @@ -314,7 +314,7 @@ public static TExpected CheckType([InvokerParameterName] string argum if (!(actualValue is TExpected)) throw CreateArgumentTypeException(argumentName, actualValue.GetType(), typeof(TExpected)); - return (TExpected) actualValue; + return (TExpected)actualValue; } @@ -391,7 +391,7 @@ public static T CheckItemsType([InvokerParameterName] string argumentName, T { // ReSharper disable CompareNonConstrainedGenericWithNull if (collection != null) - // ReSharper restore CompareNonConstrainedGenericWithNull + // ReSharper restore CompareNonConstrainedGenericWithNull { var index = 0; foreach (var item in collection) @@ -420,7 +420,7 @@ public static T CheckItemsNotNullAndType([InvokerParameterName] string argume { // ReSharper disable CompareNonConstrainedGenericWithNull if (collection != null) - // ReSharper restore CompareNonConstrainedGenericWithNull + // ReSharper restore CompareNonConstrainedGenericWithNull { var index = 0; foreach (var item in collection) diff --git a/Core.Arango/Relinq/Packages/Assertion.cs b/Core.Arango/Relinq/Packages/Assertion.cs index eb9b333664..4db6ba0687 100644 --- a/Core.Arango/Relinq/Packages/Assertion.cs +++ b/Core.Arango/Relinq/Packages/Assertion.cs @@ -15,9 +15,9 @@ // under the License. // +using JetBrains.Annotations; using System; using System.Diagnostics; -using JetBrains.Annotations; // ReSharper disable once CheckNamespace namespace Remotion.Utilities diff --git a/Core.Arango/Relinq/Packages/BaseTypeRequiredAttribute.cs b/Core.Arango/Relinq/Packages/BaseTypeRequiredAttribute.cs index 397d7b96fb..54d7aff11e 100644 --- a/Core.Arango/Relinq/Packages/BaseTypeRequiredAttribute.cs +++ b/Core.Arango/Relinq/Packages/BaseTypeRequiredAttribute.cs @@ -53,7 +53,7 @@ internal sealed class BaseTypeRequiredAttribute : Attribute /// Specifies which types are required public BaseTypeRequiredAttribute(Type baseType) { - BaseTypes = new[] {baseType}; + BaseTypes = new[] { baseType }; } /// diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/MemberBinding.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/MemberBinding.cs index a24fc7cb41..07513d4dd5 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/MemberBinding.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/MemberBinding.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.MemberBindings { @@ -59,7 +59,7 @@ public static MemberBinding Bind(MemberInfo boundMember, Expression associatedEx if (propertyInfo != null) return new PropertyInfoBinding(propertyInfo, associatedExpression); - return new FieldInfoBinding((FieldInfo) boundMember, associatedExpression); + return new FieldInfoBinding((FieldInfo)boundMember, associatedExpression); } public abstract bool MatchesReadAccess(MemberInfo member); diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/PropertyInfoBinding.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/PropertyInfoBinding.cs index d276dc9437..927be706f6 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/PropertyInfoBinding.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/MemberBindings/PropertyInfoBinding.cs @@ -41,8 +41,8 @@ public override bool MatchesReadAccess(MemberInfo member) return true; var methodInfo = member as MethodInfo; - if (methodInfo != null && ((PropertyInfo) BoundMember).CanRead && - methodInfo == ((PropertyInfo) BoundMember).GetGetMethod(true)) + if (methodInfo != null && ((PropertyInfo)BoundMember).CanRead && + methodInfo == ((PropertyInfo)BoundMember).GetGetMethod(true)) return true; return false; diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/MultiReplacingExpressionVisitor.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/MultiReplacingExpressionVisitor.cs index 60c4c0622a..1877cb0ebe 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/MultiReplacingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/MultiReplacingExpressionVisitor.cs @@ -15,10 +15,10 @@ // under the License. // -using System.Collections.Generic; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors { diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/PartialEvaluatingExpressionVisitor.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/PartialEvaluatingExpressionVisitor.cs index aed8976ee5..4959709bbe 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/PartialEvaluatingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/PartialEvaluatingExpressionVisitor.cs @@ -15,12 +15,12 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors { @@ -118,7 +118,7 @@ private Expression EvaluateSubtree(Expression subtree) if (subtree.NodeType == ExpressionType.Constant) { - var constantExpression = (ConstantExpression) subtree; + var constantExpression = (ConstantExpression)subtree; var valueAsIQueryable = constantExpression.Value as IQueryable; if (valueAsIQueryable != null && valueAsIQueryable.Expression != constantExpression) return valueAsIQueryable.Expression; diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/ReplacingExpressionVisitor.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/ReplacingExpressionVisitor.cs index 7fb91bd5bd..93f4552d6f 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/ReplacingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/ReplacingExpressionVisitor.cs @@ -15,9 +15,9 @@ // under the License. // -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors { diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/SubQueryFindingExpressionVisitor.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/SubQueryFindingExpressionVisitor.cs index fd0a22e6a2..e13b3b803a 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/SubQueryFindingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/SubQueryFindingExpressionVisitor.cs @@ -15,11 +15,11 @@ // under the License. // -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing.Structure; using Core.Arango.Relinq.Parsing.Structure.ExpressionTreeProcessors; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors { diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/ExpressionTransformerRegistry.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/ExpressionTransformerRegistry.cs index 28bea02e7f..12df77c75d 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/ExpressionTransformerRegistry.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/ExpressionTransformerRegistry.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Collections; +using Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation.PredefinedTransformations; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Collections; -using Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation.PredefinedTransformations; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation { @@ -180,7 +180,7 @@ private static Expression TransformExpression(Expression expression, IExpress T castExpression; try { - castExpression = (T) expression; + castExpression = (T)expression; } catch (InvalidCastException ex) { diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/AttributeEvaluatingExpressionTransformer.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/AttributeEvaluatingExpressionTransformer.cs index 1157c93e74..db59f7533c 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/AttributeEvaluatingExpressionTransformer.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/AttributeEvaluatingExpressionTransformer.cs @@ -15,11 +15,11 @@ // under the License. // +using Remotion.Utilities; using System; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation.PredefinedTransformations { @@ -34,7 +34,7 @@ internal class AttributeEvaluatingExpressionTransformer : IExpressionTransformer { public ExpressionType[] SupportedExpressionTypes { - get { return new[] {ExpressionType.Call, ExpressionType.MemberAccess}; } + get { return new[] { ExpressionType.Call, ExpressionType.MemberAccess }; } } public Expression Transform(Expression expression) @@ -44,7 +44,7 @@ public Expression Transform(Expression expression) var memberExpression = expression as MemberExpression; if (memberExpression != null && memberExpression.Member is PropertyInfo) { - var property = (PropertyInfo) memberExpression.Member; + var property = (PropertyInfo)memberExpression.Member; var getter = property.GetGetMethod(true); Assertion.IsNotNull(getter, "No get-method was found for property '{0}' declared on type '{1}'.", property.Name, property.DeclaringType); diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/InvocationOfLambdaExpressionTransformer.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/InvocationOfLambdaExpressionTransformer.cs index 245c8f748c..2afff28d80 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/InvocationOfLambdaExpressionTransformer.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/InvocationOfLambdaExpressionTransformer.cs @@ -15,10 +15,10 @@ // under the License. // +using Remotion.Utilities; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq.Expressions; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation.PredefinedTransformations { @@ -35,7 +35,7 @@ internal class InvocationOfLambdaExpressionTransformer : IExpressionTransformer< { public ExpressionType[] SupportedExpressionTypes { - get { return new[] {ExpressionType.Invoke}; } + get { return new[] { ExpressionType.Invoke }; } } public Expression Transform(InvocationExpression expression) @@ -53,9 +53,9 @@ public Expression Transform(InvocationExpression expression) private Expression StripTrivialConversions(Expression invokedExpression) { while (invokedExpression.NodeType == ExpressionType.Convert - && invokedExpression.Type == ((UnaryExpression) invokedExpression).Operand.Type - && ((UnaryExpression) invokedExpression).Method == null) - invokedExpression = ((UnaryExpression) invokedExpression).Operand; + && invokedExpression.Type == ((UnaryExpression)invokedExpression).Operand.Type + && ((UnaryExpression)invokedExpression).Method == null) + invokedExpression = ((UnaryExpression)invokedExpression).Operand; return invokedExpression; } diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MemberAddingNewExpressionTransformerBase.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MemberAddingNewExpressionTransformerBase.cs index 7cf493d381..d81c96c3a4 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MemberAddingNewExpressionTransformerBase.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MemberAddingNewExpressionTransformerBase.cs @@ -15,11 +15,11 @@ // under the License. // +using Remotion.Utilities; using System; using System.Collections.ObjectModel; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation.PredefinedTransformations { @@ -32,15 +32,15 @@ internal abstract class MemberAddingNewExpressionTransformerBase : IExpressionTr { public ExpressionType[] SupportedExpressionTypes { - get { return new[] {ExpressionType.New}; } + get { return new[] { ExpressionType.New }; } } public Expression Transform(NewExpression expression) { ArgumentUtility.CheckNotNull("expression", expression); -// ReSharper disable ConditionIsAlwaysTrueOrFalse -// ReSharper disable HeuristicUnreachableCode + // ReSharper disable ConditionIsAlwaysTrueOrFalse + // ReSharper disable HeuristicUnreachableCode if (expression.Members == null && CanAddMembers(expression.Type, expression.Arguments)) { var members = GetMembers(expression.Constructor, expression.Arguments); @@ -49,8 +49,8 @@ public Expression Transform(NewExpression expression) RelinqExpressionVisitor.AdjustArgumentsForNewExpression(expression.Arguments, members), members); } -// ReSharper restore HeuristicUnreachableCode -// ReSharper restore ConditionIsAlwaysTrueOrFalse + // ReSharper restore HeuristicUnreachableCode + // ReSharper restore ConditionIsAlwaysTrueOrFalse return expression; } diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MethodCallExpressionTransformerAttribute.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MethodCallExpressionTransformerAttribute.cs index bb086247ef..1e1eceee5b 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MethodCallExpressionTransformerAttribute.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/MethodCallExpressionTransformerAttribute.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System; using System.Linq.Expressions; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation.PredefinedTransformations { @@ -50,7 +50,7 @@ public IExpressionTransformer GetExpressionTransformer(Met ArgumentUtility.CheckNotNull("expression", expression); try { - return (IExpressionTransformer) Activator.CreateInstance(TransformerType); + return (IExpressionTransformer)Activator.CreateInstance(TransformerType); } catch (MissingMemberException ex) { diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/NullableValueTransformer.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/NullableValueTransformer.cs index c050f18574..4f7b82c9ef 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/NullableValueTransformer.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/Transformation/PredefinedTransformations/NullableValueTransformer.cs @@ -15,10 +15,10 @@ // under the License. // +using Remotion.Utilities; using System; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation.PredefinedTransformations { @@ -31,7 +31,7 @@ internal class NullableValueTransformer : IExpressionTransformer GetMemberBindingsCreatedByExpression(Expressi return memberInitExpression.Bindings .Where(binding => binding is MemberAssignment) .Select(assignment => - MemberBinding.Bind(assignment.Member, ((MemberAssignment) assignment).Expression)); + MemberBinding.Bind(assignment.Member, ((MemberAssignment)assignment).Expression)); var newExpression = expression as NewExpression; if (newExpression != null && newExpression.Members != null) diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableExpressionFilterBase.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableExpressionFilterBase.cs index 360d18720b..511459b9a9 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableExpressionFilterBase.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableExpressionFilterBase.cs @@ -15,8 +15,8 @@ // under the License. // -using System.Linq.Expressions; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation { diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableTreeFindingExpressionVisitor.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableTreeFindingExpressionVisitor.cs index f0cd02baac..28c8f30bc4 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableTreeFindingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/EvaluatableTreeFindingExpressionVisitor.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Clauses.Expressions; +using JetBrains.Annotations; +using Remotion.Utilities; using System; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses.Expressions; -using JetBrains.Annotations; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation { @@ -86,7 +86,7 @@ private EvaluatableTreeFindingExpressionVisitor(IEvaluatableExpressionFilter eva public override Expression Visit(Expression expression) { if (expression == null) - return base.Visit((Expression) null); + return base.Visit((Expression)null); // An expression node/subtree is evaluatable iff: // - by itself it would be evaluatable, and diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/IEvaluatableExpressionFilter.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/IEvaluatableExpressionFilter.cs index fe1aa2b29e..63eb05fe16 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/IEvaluatableExpressionFilter.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/IEvaluatableExpressionFilter.cs @@ -15,8 +15,8 @@ // under the License. // -using System.Linq.Expressions; using JetBrains.Annotations; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation { diff --git a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/PartialEvaluationInfo.cs b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/PartialEvaluationInfo.cs index 915fa1fd69..54e23e988c 100644 --- a/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/PartialEvaluationInfo.cs +++ b/Core.Arango/Relinq/Parsing/ExpressionVisitors/TreeEvaluation/PartialEvaluationInfo.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System.Collections.Generic; using System.Linq.Expressions; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation { diff --git a/Core.Arango/Relinq/Parsing/RelinqExpressionVisitor.cs b/Core.Arango/Relinq/Parsing/RelinqExpressionVisitor.cs index 0436453281..0bbbca697c 100644 --- a/Core.Arango/Relinq/Parsing/RelinqExpressionVisitor.cs +++ b/Core.Arango/Relinq/Parsing/RelinqExpressionVisitor.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Clauses.Expressions; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses.Expressions; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing { diff --git a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeParser.cs b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeParser.cs index f466360747..b4fd06101a 100644 --- a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeParser.cs +++ b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeParser.cs @@ -15,11 +15,6 @@ // under the License. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation; using Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation; @@ -28,6 +23,11 @@ using Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure { diff --git a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/CompoundExpressionTreeProcessor.cs b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/CompoundExpressionTreeProcessor.cs index ae03d0197e..c2cc2fbcd6 100644 --- a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/CompoundExpressionTreeProcessor.cs +++ b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/CompoundExpressionTreeProcessor.cs @@ -15,10 +15,10 @@ // under the License. // +using Remotion.Utilities; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.ExpressionTreeProcessors { diff --git a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/NullExpressionTreeProcessor.cs b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/NullExpressionTreeProcessor.cs index 7c9b6477be..e58d1f4e43 100644 --- a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/NullExpressionTreeProcessor.cs +++ b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/NullExpressionTreeProcessor.cs @@ -15,8 +15,8 @@ // under the License. // -using System.Linq.Expressions; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.ExpressionTreeProcessors { diff --git a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/PartialEvaluatingExpressionTreeProcessor.cs b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/PartialEvaluatingExpressionTreeProcessor.cs index 938f27ecc3..6144e120a3 100644 --- a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/PartialEvaluatingExpressionTreeProcessor.cs +++ b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/PartialEvaluatingExpressionTreeProcessor.cs @@ -15,10 +15,10 @@ // under the License. // -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.ExpressionTreeProcessors { diff --git a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/TransformingExpressionTreeProcessor.cs b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/TransformingExpressionTreeProcessor.cs index 245a575386..d127491fe8 100644 --- a/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/TransformingExpressionTreeProcessor.cs +++ b/Core.Arango/Relinq/Parsing/Structure/ExpressionTreeProcessors/TransformingExpressionTreeProcessor.cs @@ -15,10 +15,10 @@ // under the License. // -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.ExpressionTreeProcessors { diff --git a/Core.Arango/Relinq/Parsing/Structure/IExpressionTreeProcessor.cs b/Core.Arango/Relinq/Parsing/Structure/IExpressionTreeProcessor.cs index 5e1a71b7e8..d7e3236bd0 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IExpressionTreeProcessor.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IExpressionTreeProcessor.cs @@ -15,9 +15,9 @@ // under the License. // -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation; using Core.Arango.Relinq.Parsing.Structure.ExpressionTreeProcessors; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure { diff --git a/Core.Arango/Relinq/Parsing/Structure/INodeTypeProvider.cs b/Core.Arango/Relinq/Parsing/Structure/INodeTypeProvider.cs index 2207c3495d..ab7af5c3a8 100644 --- a/Core.Arango/Relinq/Parsing/Structure/INodeTypeProvider.cs +++ b/Core.Arango/Relinq/Parsing/Structure/INodeTypeProvider.cs @@ -15,10 +15,10 @@ // under the License. // +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; namespace Core.Arango.Relinq.Parsing.Structure { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateExpressionNode.cs index 51b6929759..684af8ef15 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateExpressionNode.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateFromSeedExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateFromSeedExpressionNode.cs index ca2dded84c..7de4d3fe8b 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateFromSeedExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AggregateFromSeedExpressionNode.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AllExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AllExpressionNode.cs index a6b1cb606b..4654b27a0b 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AllExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AllExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AnyExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AnyExpressionNode.cs index 2c9df6435c..9f956aacc6 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AnyExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AnyExpressionNode.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AsQueryableExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AsQueryableExpressionNode.cs index c4758d221f..8f7418ba68 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AsQueryableExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AsQueryableExpressionNode.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AverageExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AverageExpressionNode.cs index 451c1267a9..1d85ce0bf1 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AverageExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/AverageExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CastExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CastExpressionNode.cs index d7ef1fb20f..45047d42bf 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CastExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CastExpressionNode.cs @@ -15,16 +15,16 @@ // under the License. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ClauseGenerationContext.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ClauseGenerationContext.cs index 5b4e667380..69e34849c7 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ClauseGenerationContext.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ClauseGenerationContext.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System; using System.Collections.Generic; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ConcatExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ConcatExpressionNode.cs index eddf0dd444..0d4951aa03 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ConcatExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ConcatExpressionNode.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ContainsExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ContainsExpressionNode.cs index 22a63ee4ef..3044d9283c 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ContainsExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ContainsExpressionNode.cs @@ -15,16 +15,16 @@ // under the License. // -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CountExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CountExpressionNode.cs index d4ad47604d..c2c733f705 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CountExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/CountExpressionNode.cs @@ -15,16 +15,16 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DefaultIfEmptyExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DefaultIfEmptyExpressionNode.cs index 280d00a3e8..4529d5f356 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DefaultIfEmptyExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DefaultIfEmptyExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DistinctExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DistinctExpressionNode.cs index 47c238779e..8a55342e8a 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DistinctExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/DistinctExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExceptExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExceptExpressionNode.cs index 48f025eed7..67a6bb5ccf 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExceptExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExceptExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExpressionResolver.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExpressionResolver.cs index 26260e1f44..639c19a43a 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExpressionResolver.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ExpressionResolver.cs @@ -15,9 +15,9 @@ // under the License. // -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/FirstExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/FirstExpressionNode.cs index 21a8e8c9e4..833b7f76ab 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/FirstExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/FirstExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByExpressionNode.cs index afd0dfb267..69fb58e7a0 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByExpressionNode.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByWithResultSelectorExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByWithResultSelectorExpressionNode.cs index a6b314e7cd..34d617346f 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByWithResultSelectorExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupByWithResultSelectorExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Parsing.ExpressionVisitors; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Parsing.ExpressionVisitors; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { @@ -111,14 +111,14 @@ private static MethodCallExpressionParseInfo CreateParseInfoWithGroupNode( simulatedGroupByCallWithoutResultSelector = Expression.Call( typeof(Enumerable), "GroupBy", - new[] {sourceItemType, keySelector.Body.Type}, + new[] { sourceItemType, keySelector.Body.Type }, parseInfo.ParsedExpression.Arguments[0], keySelector); else simulatedGroupByCallWithoutResultSelector = Expression.Call( typeof(Enumerable), "GroupBy", - new[] {sourceItemType, keySelector.Body.Type, optionalElementSelector.Body.Type}, + new[] { sourceItemType, keySelector.Body.Type, optionalElementSelector.Body.Type }, parseInfo.ParsedExpression.Arguments[0], keySelector, optionalElementSelector); diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupJoinExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupJoinExpressionNode.cs index aa77534998..b9bf37feca 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupJoinExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/GroupJoinExpressionNode.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Parsing.ExpressionVisitors; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Parsing.ExpressionVisitors; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IExpressionNode.cs index a26086dba6..9842a9d20a 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IExpressionNode.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IntersectExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IntersectExpressionNode.cs index 9d3babdfe5..050564c782 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IntersectExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/IntersectExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/JoinExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/JoinExpressionNode.cs index 7e1c304389..a8cbbf713f 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/JoinExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/JoinExpressionNode.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Parsing.ExpressionVisitors; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Parsing.ExpressionVisitors; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LastExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LastExpressionNode.cs index 0c388712b9..360cbd1841 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LastExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LastExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LongCountExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LongCountExpressionNode.cs index 312c7c4f9d..8695c87746 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LongCountExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/LongCountExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MainSourceExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MainSourceExpressionNode.cs index c35b6648ce..a32793a90f 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MainSourceExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MainSourceExpressionNode.cs @@ -15,13 +15,13 @@ // under the License. // -using System; -using System.Collections; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { @@ -84,7 +84,7 @@ public QueryModel Apply(QueryModel queryModel, ClauseGenerationContext clauseGen var mainFromClause = CreateMainFromClause(clauseGenerationContext); var defaultSelectClause = new SelectClause(new QuerySourceReferenceExpression(mainFromClause)); - return new QueryModel(mainFromClause, defaultSelectClause) {ResultTypeOverride = QuerySourceType}; + return new QueryModel(mainFromClause, defaultSelectClause) { ResultTypeOverride = QuerySourceType }; } private MainFromClause CreateMainFromClause(ClauseGenerationContext clauseGenerationContext) diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MaxExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MaxExpressionNode.cs index b48af775e9..118ecfe52f 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MaxExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MaxExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeBase.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeBase.cs index 26ef903ede..67df35d9f0 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeBase.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeBase.cs @@ -15,11 +15,11 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeFactory.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeFactory.cs index 49186a932d..26548c7e4c 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeFactory.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionNodeFactory.cs @@ -15,11 +15,11 @@ // under the License. // +using Remotion.Utilities; using System; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { @@ -62,7 +62,7 @@ public static IExpressionNode CreateExpressionNode( GetParameterArray(constructors[0], parseInfo, additionalConstructorParameters); try { - return (IExpressionNode) constructors[0].Invoke(constructorParameterArray); + return (IExpressionNode)constructors[0].Invoke(constructorParameterArray); } catch (ArgumentException ex) { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionParseInfo.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionParseInfo.cs index f496e0f035..f4e7ee9e42 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionParseInfo.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MethodCallExpressionParseInfo.cs @@ -15,8 +15,8 @@ // under the License. // -using System.Linq.Expressions; using Remotion.Utilities; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MinExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MinExpressionNode.cs index 0a4d1a5960..5a0f807e90 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MinExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/MinExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OfTypeExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OfTypeExpressionNode.cs index 8617ccf421..eeb11cf81d 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OfTypeExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OfTypeExpressionNode.cs @@ -15,16 +15,16 @@ // under the License. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByDescendingExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByDescendingExpressionNode.cs index 66b651de76..5b47c21051 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByDescendingExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByDescendingExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByExpressionNode.cs index 75f6fa815b..2dafd4827f 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/OrderByExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceExpressionNodeUtility.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceExpressionNodeUtility.cs index c7b720cd2f..3aa1cb2441 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceExpressionNodeUtility.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceExpressionNodeUtility.cs @@ -15,13 +15,13 @@ // under the License. // -using System; -using System.Collections.Generic; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Remotion.Utilities; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { @@ -73,7 +73,7 @@ public static IQuerySource GetQuerySourceForNode(IQuerySourceExpressionNode node { try { - return (IQuerySource) context.GetContextInfo(node); + return (IQuerySource)context.GetContextInfo(node); } catch (KeyNotFoundException ex) { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceSetOperationExpressionNodeBase.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceSetOperationExpressionNodeBase.cs index ba2df4ad3d..8935bea4f3 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceSetOperationExpressionNodeBase.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/QuerySourceSetOperationExpressionNodeBase.cs @@ -1,8 +1,8 @@ -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResolvedExpressionCache.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResolvedExpressionCache.cs index 82a9fc681a..bcf0c6c749 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResolvedExpressionCache.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResolvedExpressionCache.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System; using System.Linq.Expressions; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResultOperatorExpressionNodeBase.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResultOperatorExpressionNodeBase.cs index 3e75c4dc1a..3edb25751c 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResultOperatorExpressionNodeBase.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ResultOperatorExpressionNodeBase.cs @@ -15,10 +15,10 @@ // under the License. // -using System; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Remotion.Utilities; +using System; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ReverseExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ReverseExpressionNode.cs index c968dba82a..3f564463a9 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ReverseExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ReverseExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectExpressionNode.cs index daf867746b..1332a12367 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Parsing.ExpressionVisitors; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Parsing.ExpressionVisitors; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectManyExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectManyExpressionNode.cs index 9d76f6349d..e28b163600 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectManyExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SelectManyExpressionNode.cs @@ -15,15 +15,15 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Parsing.ExpressionVisitors; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Parsing.ExpressionVisitors; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SingleExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SingleExpressionNode.cs index f80c555554..47ade01ec1 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SingleExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SingleExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SkipExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SkipExpressionNode.cs index 7a3fdfc229..7067431971 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SkipExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SkipExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SumExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SumExpressionNode.cs index 9c317b4f89..0bdbd1fa22 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SumExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SumExpressionNode.cs @@ -15,13 +15,13 @@ // under the License. // -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SupportedMethodSpecifications.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SupportedMethodSpecifications.cs index 21ae997075..9550629b7a 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SupportedMethodSpecifications.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/SupportedMethodSpecifications.cs @@ -15,12 +15,12 @@ // under the License. // +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/TakeExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/TakeExpressionNode.cs index cfc0e2e2b2..00e4983323 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/TakeExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/TakeExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByDescendingExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByDescendingExpressionNode.cs index 2908ff2512..09412617ad 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByDescendingExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByDescendingExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByExpressionNode.cs index 5d40d73d68..edabd7d8c1 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/ThenByExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/UnionExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/UnionExpressionNode.cs index 3409a5f675..9263feeada 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/UnionExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/UnionExpressionNode.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Clauses.ResultOperators; +using Core.Arango.Relinq.Utilities; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Clauses.ResultOperators; -using Core.Arango.Relinq.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/WhereExpressionNode.cs b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/WhereExpressionNode.cs index ba3fb38505..3fc1850897 100644 --- a/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/WhereExpressionNode.cs +++ b/Core.Arango/Relinq/Parsing/Structure/IntermediateModel/WhereExpressionNode.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Core.Arango.Relinq.Utilities; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses; -using Core.Arango.Relinq.Utilities; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.IntermediateModel { diff --git a/Core.Arango/Relinq/Parsing/Structure/MethodCallExpressionParser.cs b/Core.Arango/Relinq/Parsing/Structure/MethodCallExpressionParser.cs index 310e5be04c..e4743b527c 100644 --- a/Core.Arango/Relinq/Parsing/Structure/MethodCallExpressionParser.cs +++ b/Core.Arango/Relinq/Parsing/Structure/MethodCallExpressionParser.cs @@ -15,14 +15,14 @@ // under the License. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Parsing.ExpressionVisitors; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure { @@ -89,10 +89,10 @@ private Expression UnwrapArgumentExpression(Expression expression) // We only support the former three, to support the latter, PartialEvaluatingExpressionTreeVisitor must be used. if (expression.NodeType == ExpressionType.Quote) - return ((UnaryExpression) expression).Operand; + return ((UnaryExpression)expression).Operand; if (expression.NodeType == ExpressionType.Constant && - ((ConstantExpression) expression).Value is LambdaExpression) - return (Expression) ((ConstantExpression) expression).Value; + ((ConstantExpression)expression).Value is LambdaExpression) + return (Expression)((ConstantExpression)expression).Value; return expression; } diff --git a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/CompoundNodeTypeProvider.cs b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/CompoundNodeTypeProvider.cs index ba761d672f..3f93c0c083 100644 --- a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/CompoundNodeTypeProvider.cs +++ b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/CompoundNodeTypeProvider.cs @@ -15,11 +15,11 @@ // under the License. // +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders { diff --git a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodInfoBasedNodeTypeRegistry.cs b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodInfoBasedNodeTypeRegistry.cs index 7103401ae1..da3b4c3139 100644 --- a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodInfoBasedNodeTypeRegistry.cs +++ b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodInfoBasedNodeTypeRegistry.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders { @@ -214,8 +214,8 @@ private static MethodInfo[] GetGenericMethodDefinitionCandidates(MethodInfo refe var declaringTypeDefinition = referenceMethodDefinition.DeclaringType.GetGenericTypeDefinition(); var referenceMethodSignature = - new[] {new {Name = "returnValue", Type = referenceMethodDefinition.ReturnType}} - .Concat(referenceMethodDefinition.GetParameters().Select(p => new {p.Name, Type = p.ParameterType})) + new[] { new { Name = "returnValue", Type = referenceMethodDefinition.ReturnType } } + .Concat(referenceMethodDefinition.GetParameters().Select(p => new { p.Name, Type = p.ParameterType })) .ToArray(); var candidates = declaringTypeDefinition.GetRuntimeMethods() @@ -223,8 +223,8 @@ private static MethodInfo[] GetGenericMethodDefinitionCandidates(MethodInfo refe m => new { Method = m, - SignatureNames = new[] {"returnValue"}.Concat(m.GetParameters().Select(p => p.Name)).ToArray(), - SignatureTypes = new[] {m.ReturnType}.Concat(m.GetParameters().Select(p => p.ParameterType)) + SignatureNames = new[] { "returnValue" }.Concat(m.GetParameters().Select(p => p.Name)).ToArray(), + SignatureTypes = new[] { m.ReturnType }.Concat(m.GetParameters().Select(p => p.ParameterType)) .ToArray() }) .Where(c => c.Method.Name == referenceMethodDefinition.Name && diff --git a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodNameBasedNodeTypeRegistry.cs b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodNameBasedNodeTypeRegistry.cs index 5a94e848f8..79f9a0f74f 100644 --- a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodNameBasedNodeTypeRegistry.cs +++ b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/MethodNameBasedNodeTypeRegistry.cs @@ -15,14 +15,14 @@ // under the License. // +using Core.Arango.Relinq.Collections; +using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Collections; -using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders { diff --git a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/NameBasedRegistrationInfo.cs b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/NameBasedRegistrationInfo.cs index 67528acfea..d479ed7d09 100644 --- a/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/NameBasedRegistrationInfo.cs +++ b/Core.Arango/Relinq/Parsing/Structure/NodeTypeProviders/NameBasedRegistrationInfo.cs @@ -15,9 +15,9 @@ // under the License. // +using Remotion.Utilities; using System; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing.Structure.NodeTypeProviders { diff --git a/Core.Arango/Relinq/Parsing/Structure/QueryParser.cs b/Core.Arango/Relinq/Parsing/Structure/QueryParser.cs index 1c14faef1a..04b7261c51 100644 --- a/Core.Arango/Relinq/Parsing/Structure/QueryParser.cs +++ b/Core.Arango/Relinq/Parsing/Structure/QueryParser.cs @@ -15,13 +15,13 @@ // under the License. // -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Parsing.ExpressionVisitors.Transformation; using Core.Arango.Relinq.Parsing.ExpressionVisitors.TreeEvaluation; using Core.Arango.Relinq.Parsing.Structure.IntermediateModel; using Remotion.Utilities; +using System.Linq; +using System.Linq.Expressions; namespace Core.Arango.Relinq.Parsing.Structure { diff --git a/Core.Arango/Relinq/Parsing/ThrowingExpressionVisitor.cs b/Core.Arango/Relinq/Parsing/ThrowingExpressionVisitor.cs index 151fc53820..10f1afba1e 100644 --- a/Core.Arango/Relinq/Parsing/ThrowingExpressionVisitor.cs +++ b/Core.Arango/Relinq/Parsing/ThrowingExpressionVisitor.cs @@ -15,11 +15,11 @@ // under the License. // +using Core.Arango.Relinq.Clauses.Expressions; +using Remotion.Utilities; using System; using System.Linq.Expressions; using System.Reflection; -using Core.Arango.Relinq.Clauses.Expressions; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing { @@ -40,7 +40,7 @@ internal abstract class ThrowingExpressionVisitor : RelinqExpressionVisitor public override Expression Visit(Expression expression) { if (expression == null) - return base.Visit((Expression) null); + return base.Visit((Expression)null); var isCustomExpression = !ReferenceEquals(s_systemLinqAssembly, expression.GetType().GetTypeInfo().Assembly); diff --git a/Core.Arango/Relinq/Parsing/TupleExpressionBuilder.cs b/Core.Arango/Relinq/Parsing/TupleExpressionBuilder.cs index 3ad0d282b6..69f0f4070f 100644 --- a/Core.Arango/Relinq/Parsing/TupleExpressionBuilder.cs +++ b/Core.Arango/Relinq/Parsing/TupleExpressionBuilder.cs @@ -15,11 +15,11 @@ // under the License. // +using Remotion.Utilities; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Parsing { @@ -74,7 +74,7 @@ private static Expression CreateTupleExpression(Expression left, Expression righ var newTupleExpression = Expression.New( tupleType.GetTypeInfo().DeclaredConstructors.Single(), - new[] {left, right}, tupleType.GetRuntimeProperty("Key").GetGetMethod(true), + new[] { left, right }, tupleType.GetRuntimeProperty("Key").GetGetMethod(true), tupleType.GetRuntimeProperty("Value").GetGetMethod(true)); return newTupleExpression; } diff --git a/Core.Arango/Relinq/QueryModel.cs b/Core.Arango/Relinq/QueryModel.cs index 3b1eb3b689..1b5f82ca43 100644 --- a/Core.Arango/Relinq/QueryModel.cs +++ b/Core.Arango/Relinq/QueryModel.cs @@ -15,11 +15,6 @@ // under the License. // -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; -using System.Linq.Expressions; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Clauses.ResultOperators; @@ -28,6 +23,11 @@ using Core.Arango.Relinq.Parsing.Structure; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Linq; +using System.Linq.Expressions; #if !NET_3_5 #endif @@ -170,7 +170,7 @@ public Type GetResultType() public IStreamedDataInfo GetOutputDataInfo() { var outputDataInfo = ResultOperators - .Aggregate((IStreamedDataInfo) SelectClause.GetOutputDataInfo(), + .Aggregate((IStreamedDataInfo)SelectClause.GetOutputDataInfo(), (current, resultOperator) => resultOperator.GetOutputDataInfo(current)); if (ResultTypeOverride == null) @@ -385,7 +385,7 @@ public bool IsIdentityQuery() { return BodyClauses.Count == 0 && SelectClause.Selector is QuerySourceReferenceExpression - && ((QuerySourceReferenceExpression) SelectClause.Selector).ReferencedQuerySource == MainFromClause; + && ((QuerySourceReferenceExpression)SelectClause.Selector).ReferencedQuerySource == MainFromClause; } /// diff --git a/Core.Arango/Relinq/QueryModelBuilder.cs b/Core.Arango/Relinq/QueryModelBuilder.cs index 12f3b53470..4ebd58342d 100644 --- a/Core.Arango/Relinq/QueryModelBuilder.cs +++ b/Core.Arango/Relinq/QueryModelBuilder.cs @@ -15,11 +15,11 @@ // under the License. // +using Core.Arango.Relinq.Clauses; +using Remotion.Utilities; using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using Core.Arango.Relinq.Clauses; -using Remotion.Utilities; namespace Core.Arango.Relinq { diff --git a/Core.Arango/Relinq/QueryModelVisitorBase.cs b/Core.Arango/Relinq/QueryModelVisitorBase.cs index f5bee4c7d7..766bceead3 100644 --- a/Core.Arango/Relinq/QueryModelVisitorBase.cs +++ b/Core.Arango/Relinq/QueryModelVisitorBase.cs @@ -15,10 +15,10 @@ // under the License. // -using System.Collections.ObjectModel; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Collections; using Remotion.Utilities; +using System.Collections.ObjectModel; namespace Core.Arango.Relinq { diff --git a/Core.Arango/Relinq/QueryProviderBase.cs b/Core.Arango/Relinq/QueryProviderBase.cs index 3d2eb3bbe1..3f59cf0a7e 100644 --- a/Core.Arango/Relinq/QueryProviderBase.cs +++ b/Core.Arango/Relinq/QueryProviderBase.cs @@ -15,14 +15,14 @@ // under the License. // -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using Core.Arango.Relinq.Clauses.StreamedData; using Core.Arango.Relinq.Parsing.Structure; using Core.Arango.Relinq.Utilities; using Remotion.Utilities; +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace Core.Arango.Relinq { @@ -89,8 +89,8 @@ public IQueryable CreateQuery(Expression expression) ArgumentUtility.CheckNotNull("expression", expression); var elementType = ReflectionUtility.GetItemTypeOfClosedGenericIEnumerable(expression.Type, "expression"); - return (IQueryable) s_genericCreateQueryMethod.MakeGenericMethod(elementType) - .Invoke(this, new object[] {expression}); + return (IQueryable)s_genericCreateQueryMethod.MakeGenericMethod(elementType) + .Invoke(this, new object[] { expression }); } /// @@ -123,7 +123,7 @@ TResult IQueryProvider.Execute(Expression expression) ArgumentUtility.CheckNotNull("expression", expression); var resultData = Execute(expression); - return (TResult) resultData.Value; + return (TResult)resultData.Value; } /// diff --git a/Core.Arango/Relinq/QueryableBase.cs b/Core.Arango/Relinq/QueryableBase.cs index df44034f13..dd82fec2db 100644 --- a/Core.Arango/Relinq/QueryableBase.cs +++ b/Core.Arango/Relinq/QueryableBase.cs @@ -15,13 +15,13 @@ // under the License. // +using Core.Arango.Relinq.Parsing.Structure; +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Core.Arango.Relinq.Parsing.Structure; -using Remotion.Utilities; namespace Core.Arango.Relinq { diff --git a/Core.Arango/Relinq/Transformations/SubQueryFromClauseFlattener.cs b/Core.Arango/Relinq/Transformations/SubQueryFromClauseFlattener.cs index c50cd37d6e..b06586c5a2 100644 --- a/Core.Arango/Relinq/Transformations/SubQueryFromClauseFlattener.cs +++ b/Core.Arango/Relinq/Transformations/SubQueryFromClauseFlattener.cs @@ -15,15 +15,15 @@ // under the License. // -using System; -using System.Collections.ObjectModel; -using System.Linq; using Core.Arango.Relinq.Clauses; using Core.Arango.Relinq.Clauses.Expressions; using Core.Arango.Relinq.Clauses.ExpressionVisitors; using Core.Arango.Relinq.Clauses.ResultOperators; using Core.Arango.Relinq.Parsing.Structure; using Remotion.Utilities; +using System; +using System.Collections.ObjectModel; +using System.Linq; #if !NET_3_5 #endif diff --git a/Core.Arango/Relinq/UniqueIdentifierGenerator.cs b/Core.Arango/Relinq/UniqueIdentifierGenerator.cs index 4936a21b79..9d0b73dba6 100644 --- a/Core.Arango/Relinq/UniqueIdentifierGenerator.cs +++ b/Core.Arango/Relinq/UniqueIdentifierGenerator.cs @@ -15,8 +15,8 @@ // under the License. // -using System.Collections.Generic; using Remotion.Utilities; +using System.Collections.Generic; namespace Core.Arango.Relinq { diff --git a/Core.Arango/Relinq/Utilities/ItemTypeReflectionUtility.cs b/Core.Arango/Relinq/Utilities/ItemTypeReflectionUtility.cs index 920f704373..a8d3c173b4 100644 --- a/Core.Arango/Relinq/Utilities/ItemTypeReflectionUtility.cs +++ b/Core.Arango/Relinq/Utilities/ItemTypeReflectionUtility.cs @@ -15,13 +15,13 @@ // under the License. // +using JetBrains.Annotations; +using Remotion.Utilities; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; -using JetBrains.Annotations; -using Remotion.Utilities; namespace Core.Arango.Relinq.Utilities { diff --git a/Core.Arango/Relinq/Utilities/ReflectionUtility.cs b/Core.Arango/Relinq/Utilities/ReflectionUtility.cs index fa54f9e8c8..7743ee9291 100644 --- a/Core.Arango/Relinq/Utilities/ReflectionUtility.cs +++ b/Core.Arango/Relinq/Utilities/ReflectionUtility.cs @@ -15,12 +15,12 @@ // under the License. // +using Remotion.Utilities; using System; using System.Collections.ObjectModel; using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Remotion.Utilities; namespace Core.Arango.Relinq.Utilities { @@ -36,9 +36,9 @@ public static MethodInfo GetMethod(Expression> wrappedCall) switch (wrappedCall.Body.NodeType) { case ExpressionType.Call: - return ((MethodCallExpression) wrappedCall.Body).Method; + return ((MethodCallExpression)wrappedCall.Body).Method; case ExpressionType.MemberAccess: - var memberExpression = (MemberExpression) wrappedCall.Body; + var memberExpression = (MemberExpression)wrappedCall.Body; var property = memberExpression.Member as PropertyInfo; var method = property != null ? property.GetGetMethod(true) : null; if (method != null) diff --git a/Core.Arango/Serialization/IArangoSerializer.cs b/Core.Arango/Serialization/IArangoSerializer.cs index 5239170795..d5712d0888 100644 --- a/Core.Arango/Serialization/IArangoSerializer.cs +++ b/Core.Arango/Serialization/IArangoSerializer.cs @@ -1,4 +1,7 @@ using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; namespace Core.Arango.Serialization { @@ -21,5 +24,8 @@ public interface IArangoSerializer /// Convert string to object /// public object Deserialize(string value, Type type); + Task SerializeAsync(object value, CancellationToken token = default); + ValueTask DeserializeAsync(byte[] buffer, CancellationToken token = default); + ValueTask DeserializeAsync(Stream stream, CancellationToken token = default); } } \ No newline at end of file diff --git a/Core.Arango/Serialization/Json/ArangoJsonDefaultPolicy.cs b/Core.Arango/Serialization/Json/ArangoJsonDefaultPolicy.cs index dfdc2ab41e..c54c432d4b 100644 --- a/Core.Arango/Serialization/Json/ArangoJsonDefaultPolicy.cs +++ b/Core.Arango/Serialization/Json/ArangoJsonDefaultPolicy.cs @@ -1,24 +1,21 @@ using System.Text.Json; -namespace Core.Arango.Serialization.Json +namespace Core.Arango.Serialization.Json; + +/// +/// System.Json.Text PascalCase Naming Policy for Arango +/// +public class ArangoJsonDefaultPolicy : JsonNamingPolicy { - /// - /// System.Json.Text PascalCase Naming Policy for Arango - /// - public class ArangoJsonDefaultPolicy : JsonNamingPolicy - { - /// - public override string ConvertName(string name) + /// + public override string ConvertName(string name) => + name switch { - return name switch - { - "Id" => "_id", - "Key" => "_key", - "Revision" => "_rev", - "From" => "_from", - "To" => "_to", - _ => name - }; - } - } + "Id" => "_id", + "Key" => "_key", + "Revision" => "_rev", + "From" => "_from", + "To" => "_to", + _ => name + }; } \ No newline at end of file diff --git a/Core.Arango/Serialization/Json/ArangoJsonSerializer.cs b/Core.Arango/Serialization/Json/ArangoJsonSerializer.cs index 601bf33940..ee44e7cccb 100644 --- a/Core.Arango/Serialization/Json/ArangoJsonSerializer.cs +++ b/Core.Arango/Serialization/Json/ArangoJsonSerializer.cs @@ -1,150 +1,155 @@ using System; +using System.IO; using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; -namespace Core.Arango.Serialization.Json -{ - internal class ArangoJsonNullableUnixTimeConverter : JsonConverter - { - public override bool HandleNull => true; +namespace Core.Arango.Serialization.Json; - public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TryGetInt64(out var time)) - return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; +internal class ArangoJsonNullableUnixTimeConverter : JsonConverter +{ + public override bool HandleNull => true; - return null; - } + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TryGetInt64(out var time)) + return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; - public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options) - { - if (value.HasValue) - writer.WriteNumberValue(((DateTimeOffset)value.Value).ToUnixTimeMilliseconds()); - else - writer.WriteNullValue(); - } + return null; } - internal class ArangoJsonNullableUnixTimeDateTimeOffsetConverter : JsonConverter + public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options) { - public override bool HandleNull => true; + if (value.HasValue) + writer.WriteNumberValue(((DateTimeOffset)value.Value).ToUnixTimeMilliseconds()); + else + writer.WriteNullValue(); + } +} - public override DateTimeOffset? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TryGetInt64(out var time)) - return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; +internal class ArangoJsonNullableUnixTimeDateTimeOffsetConverter : JsonConverter +{ + public override bool HandleNull => true; - return null; - } + public override DateTimeOffset? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TryGetInt64(out var time)) + return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; - public override void Write(Utf8JsonWriter writer, DateTimeOffset? value, JsonSerializerOptions options) - { - if (value.HasValue) - writer.WriteNumberValue(value.Value.ToUnixTimeMilliseconds()); - else - writer.WriteNullValue(); - } + return null; } - internal class ArangoJsonUnixTimeConverter : JsonConverter + public override void Write(Utf8JsonWriter writer, DateTimeOffset? value, JsonSerializerOptions options) { - public override bool HandleNull => false; + if (value.HasValue) + writer.WriteNumberValue(value.Value.ToUnixTimeMilliseconds()); + else + writer.WriteNullValue(); + } +} - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TryGetInt64(out var time)) - return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; +internal class ArangoJsonUnixTimeConverter : JsonConverter +{ + public override bool HandleNull => false; - return DateTime.MinValue; - } + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TryGetInt64(out var time)) + return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; - public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) - { - writer.WriteNumberValue(((DateTimeOffset)value).ToUnixTimeMilliseconds()); - } + return DateTime.MinValue; } - internal class ArangoJsonUnixTimeDateTimeOffsetConverter : JsonConverter - { - public override bool HandleNull => false; + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) => + writer.WriteNumberValue(((DateTimeOffset)value).ToUnixTimeMilliseconds()); +} - public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TryGetInt64(out var time)) - return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; +internal class ArangoJsonUnixTimeDateTimeOffsetConverter : JsonConverter +{ + public override bool HandleNull => false; - return DateTimeOffset.MinValue; - } + public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TryGetInt64(out var time)) + return DateTimeOffset.FromUnixTimeMilliseconds(time).UtcDateTime; - public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options) - { - writer.WriteNumberValue(value.ToUnixTimeMilliseconds()); - } + return DateTimeOffset.MinValue; } + public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options) => + writer.WriteNumberValue(value.ToUnixTimeMilliseconds()); +} + +/// +/// Arango Json Serializer with System.Json.Text +/// +public class ArangoJsonSerializer : IArangoSerializer +{ /// - /// Arango Json Serializer with System.Json.Text + /// Use unix timestamps for DateTime and DateTimeOffset /// - public class ArangoJsonSerializer : IArangoSerializer + public bool UseTimestamps { - /// - /// Use unix timestamps for DateTime and DateTimeOffset - /// - public bool UseTimestamps + get => _useTimestamps; + set { - get => _useTimestamps; - set + _useTimestamps = value; + if (value && _options.Converters.All(x => x.GetType() != typeof(ArangoJsonUnixTimeConverter))) { - _useTimestamps = value; - if (value && _options.Converters.All(x => x.GetType() != typeof(ArangoJsonUnixTimeConverter))) - { - _options.Converters.Add(new ArangoJsonUnixTimeConverter()); - _options.Converters.Add(new ArangoJsonNullableUnixTimeConverter()); - _options.Converters.Add(new ArangoJsonUnixTimeDateTimeOffsetConverter()); - _options.Converters.Add(new ArangoJsonNullableUnixTimeDateTimeOffsetConverter()); - } + _options.Converters.Add(new ArangoJsonUnixTimeConverter()); + _options.Converters.Add(new ArangoJsonNullableUnixTimeConverter()); + _options.Converters.Add(new ArangoJsonUnixTimeDateTimeOffsetConverter()); + _options.Converters.Add(new ArangoJsonNullableUnixTimeDateTimeOffsetConverter()); } } + } - private readonly JsonSerializerOptions _options; - private bool _useTimestamps; + private readonly JsonSerializerOptions _options; + private bool _useTimestamps; - /// - /// - /// PascalCase or camelCase policy - public ArangoJsonSerializer(JsonNamingPolicy policy) + /// + /// + /// PascalCase or camelCase policy + public ArangoJsonSerializer(JsonNamingPolicy policy) + { + _options = new JsonSerializerOptions(JsonSerializerDefaults.Web) { - _options = new JsonSerializerOptions(JsonSerializerDefaults.Web) - { - PropertyNamingPolicy = policy, - //DictionaryKeyPolicy = policy, + PropertyNamingPolicy = policy, + PropertyNameCaseInsensitive = true, + //DictionaryKeyPolicy = policy, #if NET6_0_OR_GREATER - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull #else - IgnoreNullValues = false + IgnoreNullValues = false #endif - }; - - - } + }; + _options.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)); + } - /// - public string Serialize(object value) - { - return JsonSerializer.Serialize(value, _options); - } + /// + public string Serialize(object value) => JsonSerializer.Serialize(value, _options); + /// + public async Task SerializeAsync(object value, CancellationToken token = default) + { + using var ms = new MemoryStream(); + await JsonSerializer.SerializeAsync(ms, value, _options, token).ConfigureAwait(false); + return ms.ToArray(); + } + /// + public async ValueTask DeserializeAsync(byte[] buffer, CancellationToken token = default) + { + using var ms = new MemoryStream(buffer); + return await DeserializeAsync(ms, token).ConfigureAwait(false); + } + /// + public ValueTask DeserializeAsync(Stream stream, CancellationToken token = default) => + JsonSerializer.DeserializeAsync(stream, _options, token); - /// - public T Deserialize(string value) - { - return JsonSerializer.Deserialize(value, _options); - } + /// + public T Deserialize(string value) => JsonSerializer.Deserialize(value, _options); - /// - public object Deserialize(string v, Type t) - { - return JsonSerializer.Deserialize(v, t, _options); - } - } + /// + public object Deserialize(string value, Type t) => JsonSerializer.Deserialize(value, t, _options); } \ No newline at end of file diff --git a/Core.Arango/Serialization/Json/JsonStringEnumMemberConverter.cs b/Core.Arango/Serialization/Json/JsonStringEnumMemberConverter.cs index f08dcbda78..8770179c92 100644 --- a/Core.Arango/Serialization/Json/JsonStringEnumMemberConverter.cs +++ b/Core.Arango/Serialization/Json/JsonStringEnumMemberConverter.cs @@ -60,17 +60,17 @@ public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializer (var IsNullableEnum, var UnderlyingType) = TestNullableEnum(typeToConvert); return IsNullableEnum - ? (JsonConverter) Activator.CreateInstance( + ? (JsonConverter)Activator.CreateInstance( typeof(NullableEnumMemberConverter<>).MakeGenericType(UnderlyingType), BindingFlags.Instance | BindingFlags.Public, null, - new object?[] {_NamingPolicy, _AllowIntegerValues}, + new object?[] { _NamingPolicy, _AllowIntegerValues }, null) - : (JsonConverter) Activator.CreateInstance( + : (JsonConverter)Activator.CreateInstance( typeof(EnumMemberConverter<>).MakeGenericType(typeToConvert), BindingFlags.Instance | BindingFlags.Public, null, - new object?[] {_NamingPolicy, _AllowIntegerValues}, + new object?[] { _NamingPolicy, _AllowIntegerValues }, null); } diff --git a/Core.Arango/Serialization/Json/JsonStringEnumMemberConverterHelper.cs b/Core.Arango/Serialization/Json/JsonStringEnumMemberConverterHelper.cs index c3a8fdf2bc..acaec23be4 100644 --- a/Core.Arango/Serialization/Json/JsonStringEnumMemberConverterHelper.cs +++ b/Core.Arango/Serialization/Json/JsonStringEnumMemberConverterHelper.cs @@ -114,7 +114,7 @@ public JsonStringEnumMemberConverterHelper(JsonNamingPolicy? namingPolicy, bool for (var i = 0; i < builtInNames.Length; i++) { - var enumValue = (Enum?) builtInValues.GetValue(i); + var enumValue = (Enum?)builtInValues.GetValue(i); if (enumValue == null) continue; var rawValue = GetEnumValue(enumValue); @@ -175,7 +175,7 @@ public TEnum Read(ref Utf8JsonReader reader) throw GenerateJsonException(_EnumType, flagValue); } - var enumValue = (TEnum) Enum.ToObject(_EnumType, calculatedValue); + var enumValue = (TEnum)Enum.ToObject(_EnumType, calculatedValue); if (_TransformedToRaw.Count < 64) _TransformedToRaw[enumString] = new EnumInfo(enumString, enumValue, calculatedValue); return enumValue; @@ -195,28 +195,28 @@ public TEnum Read(ref Utf8JsonReader reader) switch (_EnumTypeCode) { case TypeCode.Int32: - if (reader.TryGetInt32(out var int32)) return (TEnum) Enum.ToObject(_EnumType, int32); + if (reader.TryGetInt32(out var int32)) return (TEnum)Enum.ToObject(_EnumType, int32); break; case TypeCode.Int64: - if (reader.TryGetInt64(out var int64)) return (TEnum) Enum.ToObject(_EnumType, int64); + if (reader.TryGetInt64(out var int64)) return (TEnum)Enum.ToObject(_EnumType, int64); break; case TypeCode.Int16: - if (reader.TryGetInt16(out var int16)) return (TEnum) Enum.ToObject(_EnumType, int16); + if (reader.TryGetInt16(out var int16)) return (TEnum)Enum.ToObject(_EnumType, int16); break; case TypeCode.Byte: - if (reader.TryGetByte(out var ubyte8)) return (TEnum) Enum.ToObject(_EnumType, ubyte8); + if (reader.TryGetByte(out var ubyte8)) return (TEnum)Enum.ToObject(_EnumType, ubyte8); break; case TypeCode.UInt32: - if (reader.TryGetUInt32(out var uint32)) return (TEnum) Enum.ToObject(_EnumType, uint32); + if (reader.TryGetUInt32(out var uint32)) return (TEnum)Enum.ToObject(_EnumType, uint32); break; case TypeCode.UInt64: - if (reader.TryGetUInt64(out var uint64)) return (TEnum) Enum.ToObject(_EnumType, uint64); + if (reader.TryGetUInt64(out var uint64)) return (TEnum)Enum.ToObject(_EnumType, uint64); break; case TypeCode.UInt16: - if (reader.TryGetUInt16(out var uint16)) return (TEnum) Enum.ToObject(_EnumType, uint16); + if (reader.TryGetUInt16(out var uint16)) return (TEnum)Enum.ToObject(_EnumType, uint16); break; case TypeCode.SByte: - if (reader.TryGetSByte(out var byte8)) return (TEnum) Enum.ToObject(_EnumType, byte8); + if (reader.TryGetSByte(out var byte8)) return (TEnum)Enum.ToObject(_EnumType, byte8); break; } @@ -270,28 +270,28 @@ public void Write(Utf8JsonWriter writer, TEnum value) switch (_EnumTypeCode) { case TypeCode.Int32: - writer.WriteNumberValue((int) rawValue); + writer.WriteNumberValue((int)rawValue); break; case TypeCode.Int64: - writer.WriteNumberValue((long) rawValue); + writer.WriteNumberValue((long)rawValue); break; case TypeCode.Int16: - writer.WriteNumberValue((short) rawValue); + writer.WriteNumberValue((short)rawValue); break; case TypeCode.Byte: - writer.WriteNumberValue((byte) rawValue); + writer.WriteNumberValue((byte)rawValue); break; case TypeCode.UInt32: - writer.WriteNumberValue((uint) rawValue); + writer.WriteNumberValue((uint)rawValue); break; case TypeCode.UInt64: writer.WriteNumberValue(rawValue); break; case TypeCode.UInt16: - writer.WriteNumberValue((ushort) rawValue); + writer.WriteNumberValue((ushort)rawValue); break; case TypeCode.SByte: - writer.WriteNumberValue((sbyte) rawValue); + writer.WriteNumberValue((sbyte)rawValue); break; default: throw new JsonException(); // GetEnumValue should have already thrown. @@ -302,14 +302,14 @@ private ulong GetEnumValue(object value) { return _EnumTypeCode switch { - TypeCode.Int32 => (ulong) (int) value, - TypeCode.Int64 => (ulong) (long) value, - TypeCode.Int16 => (ulong) (short) value, - TypeCode.Byte => (byte) value, - TypeCode.UInt32 => (uint) value, - TypeCode.UInt64 => (ulong) value, - TypeCode.UInt16 => (ushort) value, - TypeCode.SByte => (ulong) (sbyte) value, + TypeCode.Int32 => (ulong)(int)value, + TypeCode.Int64 => (ulong)(long)value, + TypeCode.Int16 => (ulong)(short)value, + TypeCode.Byte => (byte)value, + TypeCode.UInt32 => (uint)value, + TypeCode.UInt64 => (ulong)value, + TypeCode.UInt16 => (ushort)value, + TypeCode.SByte => (ulong)(sbyte)value, _ => throw new NotSupportedException($"Enum '{value}' of {_EnumTypeCode} type is not supported.") }; } diff --git a/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftCamelCaseContractResolver.cs b/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftCamelCaseContractResolver.cs index 7d5f039214..a1dbef1d83 100644 --- a/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftCamelCaseContractResolver.cs +++ b/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftCamelCaseContractResolver.cs @@ -1,6 +1,6 @@ -using System.Reflection; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using System.Reflection; namespace Core.Arango.Serialization.Newtonsoft { diff --git a/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftDefaultContractResolver.cs b/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftDefaultContractResolver.cs index e6737d4987..84fb2ba383 100644 --- a/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftDefaultContractResolver.cs +++ b/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftDefaultContractResolver.cs @@ -1,6 +1,6 @@ -using System.Reflection; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using System.Reflection; namespace Core.Arango.Serialization.Newtonsoft { diff --git a/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftSerializer.cs b/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftSerializer.cs index 4f00d09e74..db1ca13cc9 100644 --- a/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftSerializer.cs +++ b/Core.Arango/Serialization/Newtonsoft/ArangoNewtonsoftSerializer.cs @@ -1,48 +1,71 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; -namespace Core.Arango.Serialization.Newtonsoft +namespace Core.Arango.Serialization.Newtonsoft; + +/// +/// Arango Json Serializer with Newtonsoft +/// +public class ArangoNewtonsoftSerializer : IArangoSerializer { + private readonly JsonSerializerSettings _settings; + /// /// Arango Json Serializer with Newtonsoft /// - public class ArangoNewtonsoftSerializer : IArangoSerializer - { - private readonly JsonSerializerSettings _settings; - - /// - /// Arango Json Serializer with Newtonsoft - /// - /// PascalCase or camelCaseResolver - public ArangoNewtonsoftSerializer(IContractResolver resolver) + /// PascalCase or camelCaseResolver + public ArangoNewtonsoftSerializer(IContractResolver resolver) => + _settings = new JsonSerializerSettings { - _settings = new JsonSerializerSettings - { - ContractResolver = resolver, - ReferenceLoopHandling = ReferenceLoopHandling.Ignore, - Formatting = Formatting.None, - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc - }; - } + ContractResolver = resolver, + ReferenceLoopHandling = ReferenceLoopHandling.Ignore, + Formatting = Formatting.None, + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc + }; - /// - public string Serialize(object value) - { - return JsonConvert.SerializeObject(value, _settings); - } + /// + public string Serialize(object value) => JsonConvert.SerializeObject(value, _settings); - /// - public T Deserialize(string value) - { - return JsonConvert.DeserializeObject(value, _settings); - } + /// + public T Deserialize(string value) => JsonConvert.DeserializeObject(value, _settings); - /// - public object Deserialize(string v, Type t) + /// + public object Deserialize(string v, Type t) => JsonConvert.DeserializeObject(v, t, _settings); + /// + public Task SerializeAsync(object value, CancellationToken token = default) + { + return Task.Run(() => + { + var str = Serialize(value); + return Encoding.UTF8.GetBytes(str); + }); + } + /// + public async ValueTask DeserializeAsync(byte[] buffer, CancellationToken token = default) + { + var obj = await Task.Run(() => + { + var str = Encoding.UTF8.GetString(buffer); + return Deserialize(str); + }).ConfigureAwait(false); + return await ValueTask.FromResult(obj); + } + /// + public async ValueTask DeserializeAsync(Stream stream, CancellationToken token = default) + { + var obj = await Task.Run(() => { - return JsonConvert.DeserializeObject(v, t, _settings); - } + using var reader = new StreamReader(stream); + JsonSerializer jsonSerializer = new(); + var res = jsonSerializer.Deserialize(reader, typeof(T)); + return (T)res; + }).ConfigureAwait(false); + return obj; } } \ No newline at end of file diff --git a/Core.Arango/Transport/ArangoHttpTransport.cs b/Core.Arango/Transport/ArangoHttpTransport.cs index cbbab71d52..84257b474d 100644 --- a/Core.Arango/Transport/ArangoHttpTransport.cs +++ b/Core.Arango/Transport/ArangoHttpTransport.cs @@ -1,206 +1,235 @@ -using System; +using Core.Arango.Protocol; +using Core.Arango.Protocol.Internal; +using Core.Arango.Serialization; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.IdentityModel.Tokens.Jwt; using System.Linq; using System.Net; using System.Net.Http; +using System.Net.Http.Headers; using System.Text; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; -using Core.Arango.Protocol; -using Core.Arango.Protocol.Internal; -using Newtonsoft.Json; -namespace Core.Arango.Transport +namespace Core.Arango.Transport; + +/// +/// Arango HTTP 1.1/2.0 Transport Implementation +/// +public class ArangoHttpTransport(IArangoConfiguration configuration) : IArangoTransport { - /// - /// Arango HTTP 1.1/2.0 Transport Implementation - /// - public class ArangoHttpTransport : IArangoTransport + private readonly HttpClient httpClient = configuration.HttpClient ?? new(); + private string _auth = ""; + private DateTime _authValidUntil = DateTime.MinValue; + + /// + protected string BasicAuth { - private static readonly HttpClient DefaultHttpClient = new(); - private readonly IArangoConfiguration _configuration; - private readonly HttpClient _httpClient; - private string _auth; - private DateTime _authValidUntil = DateTime.MinValue; - - /// - /// Arango HTTP 1.1/2.0 Transport Implementation - /// - public ArangoHttpTransport(IArangoConfiguration configuration) + get { - _configuration = configuration; - _httpClient = configuration.HttpClient ?? DefaultHttpClient; + if (string.IsNullOrWhiteSpace(_auth) && !string.IsNullOrWhiteSpace(configuration.User) && !string.IsNullOrWhiteSpace(configuration.Password)) + _auth = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{configuration.User}:{configuration.Password}")); + return _auth; } + } - /// - public async Task SendAsync(HttpMethod m, string url, object body = null, - string transaction = null, bool throwOnError = true, bool auth = true, - IDictionary headers = null, - CancellationToken cancellationToken = default) + private async Task Authenticate(bool auth, CancellationToken cancellationToken) + { + if (string.IsNullOrWhiteSpace(configuration.User)) + return; + + if (auth && (_auth == null || _authValidUntil < DateTime.UtcNow)) { - await Authenticate(auth, cancellationToken).ConfigureAwait(false); + var authResponse = await SendAsync(HttpMethod.Post, + "/_open/auth", + new AuthRequest + { + Username = configuration.User, + Password = configuration.Password ?? string.Empty + }, auth: false, cancellationToken: cancellationToken).ConfigureAwait(false); + + var jwt = authResponse.Jwt; + var token = new JwtSecurityToken(jwt.Replace("=", "")); + _auth = $"Bearer {jwt}"; + _authValidUntil = token.ValidTo.AddMinutes(-5); + } + } - var msg = new HttpRequestMessage(m, _configuration.Server + url); - ApplyHeaders(transaction, auth, msg, headers); + /// + public async Task SendAsync(HttpMethod m, string url, object body = null, + string transaction = null, bool throwOnError = true, bool auth = true, + IDictionary headers = null, + CancellationToken cancellationToken = default) + { + auth = false; + if (auth) + await Authenticate(auth, cancellationToken).ConfigureAwait(false); - if (body != null) - { - var json = _configuration.Serializer.Serialize(body); - msg.Content = new StringContent(json, Encoding.UTF8, - "application/json"); - } + do + { + var req = new HttpRequestMessage(m, configuration.Server + url); + ApplyHeaders(transaction, auth, req, headers); + //var json = ToJson(configuration, body); + //if (!string.IsNullOrEmpty(json)) + // req.Content = new StringContent(json, Encoding.UTF8, "application/json"); + var data = ToByteArray(configuration, body); + if (data != null && data.Length > 0) + req.Content = new ByteArrayContent(data); else + req.Headers.Add(HttpRequestHeader.ContentLength.ToString(), "0"); + SetBasicAuth(httpClient); + var (retryMax, retryCount) = (5, 0); + try { - msg.Headers.Add(HttpRequestHeader.ContentLength.ToString(), "0"); + return await GetResponse(configuration.Serializer, req, cancellationToken).ConfigureAwait(false); } - - var res = await _httpClient.SendAsync(msg, cancellationToken).ConfigureAwait(false); - - if (!res.IsSuccessStatusCode) - if (throwOnError) - { - var errorContent = await res.Content.ReadAsStringAsync().ConfigureAwait(false); - var error = _configuration.Serializer.Deserialize(errorContent); - throw new ArangoException(errorContent, error.ErrorMessage, - (HttpStatusCode) error.Code, (ArangoErrorCode) error.ErrorNum); - } - else - { - return default; - } - - var content = await res.Content.ReadAsStringAsync().ConfigureAwait(false); - - if (res.Headers.Contains("X-Arango-Error-Codes")) + catch (ArangoException exc) { - var errors = _configuration.Serializer.Deserialize>(content) - .Select(error => new ArangoError(error.ErrorMessage, (ArangoErrorCode) error.ErrorNum)); - throw new ArangoException(content, errors); + if (++retryCount >= retryMax) + throw; + await Task.Delay(500, cancellationToken).ConfigureAwait(false); } + } while (true); + } - if (content == "{}" || string.IsNullOrWhiteSpace(content)) - return default; + private static byte[] ToByteArray(IArangoConfiguration configuration, object body) + { + if (body == null) + return []; + var json = configuration.Serializer.Serialize(body); + if (!string.IsNullOrWhiteSpace(json)) + return Encoding.UTF8.GetBytes(json); + return []; + } + private static string ToJson(IArangoConfiguration configuration, object body) + { + if (body == null) + return string.Empty; + return configuration.Serializer.Serialize(body); + } - return _configuration.Serializer.Deserialize(content); + private async Task GetResponse(IArangoSerializer serializer, HttpRequestMessage req, CancellationToken cancellationToken) + { + var res = await httpClient.SendAsync(req, cancellationToken).ConfigureAwait(false); + var content = await res.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + if (!res.IsSuccessStatusCode) + { + var error = serializer.Deserialize(content); + throw new ArangoException(content, error.ErrorMessage, + (HttpStatusCode)error.Code, (ArangoErrorCode)error.ErrorNum); } - - /// - public async Task SendContentAsync(HttpMethod m, string url, HttpContent body = null, - string transaction = null, - bool throwOnError = true, bool auth = true, IDictionary headers = null, - CancellationToken cancellationToken = default) + if (res.Headers.Contains("X-Arango-Error-Codes")) { - await Authenticate(auth, cancellationToken); - - var msg = new HttpRequestMessage(m, _configuration.Server + url); - ApplyHeaders(transaction, auth, msg, headers); - msg.Content = body; - - var res = await _httpClient.SendAsync(msg, cancellationToken); - - if (!res.IsSuccessStatusCode) - if (throwOnError) - { - var errorContent = await res.Content.ReadAsStringAsync(); - var error = _configuration.Serializer.Deserialize(errorContent); - throw new ArangoException(errorContent, error.ErrorMessage, - (HttpStatusCode) error.Code, (ArangoErrorCode) error.ErrorNum); - } - - return res.Content; + var errors = configuration.Serializer.Deserialize>(content) + .Select(error => new ArangoError(error.ErrorMessage, (ArangoErrorCode)error.ErrorNum)); + throw new ArangoException("HeaderError: " + content, errors); } + if (content == "{}" || string.IsNullOrWhiteSpace(content)) + return default; + return configuration.Serializer.Deserialize(content); + } - /// - public async Task SendAsync(Type type, HttpMethod m, string url, object body = null, - string transaction = null, bool throwOnError = true, bool auth = true, - IDictionary headers = null, - CancellationToken cancellationToken = default) - { - await Authenticate(auth, cancellationToken).ConfigureAwait(false); + /// + public async Task SendAsync(Type type, HttpMethod m, string url, object body = null, + string transaction = null, bool throwOnError = true, bool auth = true, + IDictionary headers = null, + CancellationToken cancellationToken = default) + { + await Authenticate(auth, cancellationToken).ConfigureAwait(false); - var msg = new HttpRequestMessage(m, _configuration.Server + url); - ApplyHeaders(transaction, auth, msg, headers); + var req = new HttpRequestMessage(m, configuration.Server + url); + ApplyHeaders(transaction, auth, req, headers); - if (body != null) - msg.Content = new StringContent(_configuration.Serializer.Serialize(body), Encoding.UTF8, - "application/json"); - else - msg.Headers.Add(HttpRequestHeader.ContentLength.ToString(), "0"); + if (body != null) + { + var json = configuration.Serializer.Serialize(body); + req.Content = new ByteArrayContent(Encoding.UTF8.GetBytes(json)); + } + else + req.Headers.Add(HttpRequestHeader.ContentLength.ToString(), "0"); + SetBasicAuth(httpClient); + var res = await httpClient.SendAsync(req, cancellationToken).ConfigureAwait(false); + var content = await res.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - var res = await _httpClient.SendAsync(msg, cancellationToken).ConfigureAwait(false); + if (!res.IsSuccessStatusCode) + if (throwOnError) + throw new ArangoException(content); + else return default; - if (!res.IsSuccessStatusCode) - if (throwOnError) - throw new ArangoException(await res.Content.ReadAsStringAsync().ConfigureAwait(false)); - else return default; + if (content == "{}" || string.IsNullOrWhiteSpace(content)) + return default; - var content = await res.Content.ReadAsStringAsync().ConfigureAwait(false); + return configuration.Serializer.Deserialize(content, type); + } - if (content == "{}" || string.IsNullOrWhiteSpace(content)) - return default; + /// + public async Task SendContentAsync(HttpMethod m, string url, HttpContent body = null, + string transaction = null, + bool throwOnError = true, bool auth = true, IDictionary headers = null, + CancellationToken cancellationToken = default) + { + await Authenticate(auth, cancellationToken).ConfigureAwait(false); - return _configuration.Serializer.Deserialize(content, type); - } + var req = new HttpRequestMessage(m, configuration.Server + url); + ApplyHeaders(transaction, auth, req, headers); + req.Content = body; + SetBasicAuth(httpClient); + var res = await httpClient.SendAsync(req, cancellationToken); - private void ApplyHeaders(string transaction, bool auth, HttpRequestMessage msg, - IDictionary headers) + if (!res.IsSuccessStatusCode && throwOnError) { - msg.Headers.Add(HttpRequestHeader.KeepAlive.ToString(), "true"); + var errorContent = await res.Content.ReadAsStringAsync(cancellationToken); + var error = configuration.Serializer.Deserialize(errorContent); + throw new ArangoException(errorContent, error.ErrorMessage, + (HttpStatusCode)error.Code, (ArangoErrorCode)error.ErrorNum); + } + return res.Content; + } - if (auth && !string.IsNullOrWhiteSpace(_auth)) - msg.Headers.Add(HttpRequestHeader.Authorization.ToString(), _auth); + /// + /// When using Basic auth, call this method to set the username and password + /// used in requests to ArangoDB. + /// + /// + protected void SetBasicAuth(HttpClient client) => client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", BasicAuth); - if (transaction != null) - msg.Headers.Add("x-arango-trx-id", transaction); + private void ApplyHeaders(string transaction, bool auth, HttpRequestMessage msg, + IDictionary headers) + { + msg.Headers.Add(HttpRequestHeader.KeepAlive.ToString(), "true"); - if (_configuration.AllowDirtyRead) - msg.Headers.Add("x-arango-allow-dirty-read", "true"); + if (auth && !string.IsNullOrWhiteSpace(_auth)) + msg.Headers.Add(HttpRequestHeader.Authorization.ToString(), _auth); - if (headers != null) - foreach (var header in headers) - msg.Headers.Add(header.Key, header.Value); - } + if (transaction != null) + msg.Headers.Add("x-arango-trx-id", transaction); - private async Task Authenticate(bool auth, CancellationToken cancellationToken) - { - if (string.IsNullOrWhiteSpace(_configuration.User)) - return; + if (configuration.AllowDirtyRead) + msg.Headers.Add("x-arango-allow-dirty-read", "true"); - if (auth && (_auth == null || _authValidUntil < DateTime.UtcNow)) - { - var authResponse = await SendAsync(HttpMethod.Post, - "/_open/auth", - new AuthRequest - { - Username = _configuration.User, - Password = _configuration.Password ?? string.Empty - }, auth: false, cancellationToken: cancellationToken).ConfigureAwait(false); - - var jwt = authResponse.Jwt; - var token = new JwtSecurityToken(jwt.Replace("=", "")); - _auth = $"Bearer {jwt}"; - _authValidUntil = token.ValidTo.AddMinutes(-5); - } - } + if (headers != null) + foreach (var header in headers) + msg.Headers.Add(header.Key, header.Value); + } - private class AuthRequest - { - [JsonProperty("username")] - [JsonPropertyName("username")] - public string Username { get; set; } + private class AuthRequest + { + [JsonProperty("username")] + [JsonPropertyName("username")] + public string Username { get; set; } - [JsonProperty("password")] - [JsonPropertyName("password")] - public string Password { get; set; } - } + [JsonProperty("password")] + [JsonPropertyName("password")] + public string Password { get; set; } + } - private class AuthResponse - { - [JsonProperty("jwt")] - [JsonPropertyName("jwt")] - public string Jwt { get; set; } - } + private class AuthResponse + { + [JsonProperty("jwt")] + [JsonPropertyName("jwt")] + public string Jwt { get; set; } } } \ No newline at end of file