Skip to content

Commit 0c4653a

Browse files
committed
Merge branch 'master' into master-ignore-indexes
# Conflicts: # Orm/Xtensive.Orm/Orm/Configuration/DomainConfiguration.cs
2 parents 50e0156 + 8096d82 commit 0c4653a

38 files changed

+855
-785
lines changed

Extensions/TestCommon/TestCommon.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
99
</PropertyGroup>
1010
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
11+
<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
12+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
13+
</ItemGroup>
14+
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
15+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
16+
</ItemGroup>
1117
<ItemGroup>
1218
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
1319
<PackageReference Include="NUnit" Version="3.13.2" />
1420
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
15-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1621
</ItemGroup>
1722
<ItemGroup>
1823
<ProjectReference Include="..\..\Orm\Xtensive.Orm.Tests.Framework\Xtensive.Orm.Tests.Framework.csproj" />

Extensions/Xtensive.Orm.Reprocessing/Xtensive.Orm.Reprocessing.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
<SignAssembly>true</SignAssembly>
1313
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
1414
</PropertyGroup>
15-
<ItemGroup>
15+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
1616
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1717
</ItemGroup>
18+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
19+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
20+
</ItemGroup>
1821
<ItemGroup>
1922
<None Include="Readme.txt" />
2023
</ItemGroup>

Extensions/Xtensive.Orm.Security/Xtensive.Orm.Security.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
1414
</PropertyGroup>
1515
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
16-
<ItemGroup>
16+
<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
1717
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1818
</ItemGroup>
19+
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
20+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
21+
</ItemGroup>
1922
<ItemGroup>
2023
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />
2124
</ItemGroup>

Extensions/Xtensive.Orm.Tracking/Xtensive.Orm.Tracking.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
<SignAssembly>true</SignAssembly>
1313
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
1414
</PropertyGroup>
15-
<ItemGroup>
15+
<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
1616
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1717
</ItemGroup>
18+
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
19+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
20+
</ItemGroup>
1821
<ItemGroup>
1922
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />
2023
</ItemGroup>

Extensions/Xtensive.Orm.Web/Xtensive.Orm.Web.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@
1515
<ItemGroup>
1616
<None Include="Readme.txt" />
1717
</ItemGroup>
18+
<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
19+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
20+
</ItemGroup>
21+
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
22+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
23+
</ItemGroup>
1824
<ItemGroup>
1925
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
2026
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
2127
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
2228
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
23-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
2429
</ItemGroup>
2530
<ItemGroup>
2631
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />

Orm/Xtensive.Orm.Tests.Framework/DomainModelExtensions.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void Dump(this TypeInfoCollection target)
8181

8282
public static void DumpAncestor(this TypeInfo target, int indent)
8383
{
84-
TypeInfo ancestor = target.GetAncestor();
84+
TypeInfo ancestor = target.Ancestor;
8585
if (ancestor!=null)
8686
WriteLine(indent + 1, "Ancestor: " + ancestor.Name);
8787
else {
@@ -92,8 +92,8 @@ public static void DumpAncestor(this TypeInfo target, int indent)
9292
public static void DumpDescendants(this TypeInfo target, int indent)
9393
{
9494
WriteLine(indent, "Descendants:");
95-
HashSet<TypeInfo> direct = new HashSet<TypeInfo>(target.GetDescendants());
96-
foreach (TypeInfo descendant in target.GetDescendants(true)) {
95+
HashSet<TypeInfo> direct = new HashSet<TypeInfo>(target.DirectDescendants);
96+
foreach (TypeInfo descendant in target.AllDescendants) {
9797
if (direct.Contains(descendant))
9898
WriteLine(indent + 1, descendant.Name + " (direct)");
9999
else
@@ -104,8 +104,8 @@ public static void DumpDescendants(this TypeInfo target, int indent)
104104
public static void DumpInterfaces(this TypeInfo target, int indent)
105105
{
106106
WriteLine(indent, "Interfaces:");
107-
HashSet<TypeInfo> direct = new HashSet<TypeInfo>(target.GetInterfaces());
108-
foreach (TypeInfo @interface in target.GetInterfaces(true)) {
107+
var direct = target.DirectInterfaces;
108+
foreach (TypeInfo @interface in target.AllInterfaces) {
109109
if (direct.Contains(@interface))
110110
WriteLine(indent + 1, @interface.Name + " (direct)");
111111
else
@@ -116,8 +116,8 @@ public static void DumpInterfaces(this TypeInfo target, int indent)
116116
public static void DumpImplementors(this TypeInfo target, int indent)
117117
{
118118
WriteLine(indent, "Implementors:");
119-
HashSet<TypeInfo> direct = new HashSet<TypeInfo>(target.GetImplementors());
120-
foreach (TypeInfo implementor in target.GetImplementors(true)) {
119+
HashSet<TypeInfo> direct = new HashSet<TypeInfo>(target.DirectImplementors);
120+
foreach (TypeInfo implementor in target.AllImplementors) {
121121
if (direct.Contains(implementor))
122122
WriteLine(indent + 1, implementor.Name + " (direct)");
123123
else
@@ -163,10 +163,10 @@ public static void Dump(this TypeInfo target, int indent)
163163
if (target.IsEntity) {
164164
WriteLine(indent, "Hierarchy: " + target.Hierarchy.Root.Name);
165165
if (target.Hierarchy.Root!=target)
166-
WriteLine(indent, "Ancestor: " + target.GetAncestor().Name);
166+
WriteLine(indent, "Ancestor: " + target.Ancestor.Name);
167167
}
168168
else if (target.IsInterface) {
169-
WriteLine(indent, "Implementors: " + target.GetImplementors().Select(t => t.Name).ToCommaDelimitedString());
169+
WriteLine(indent, "Implementors: " + target.DirectImplementors.Select(t => t.Name).ToCommaDelimitedString());
170170
}
171171

172172
target.DumpMappingName(indent);

Orm/Xtensive.Orm.Tests.Framework/Orm.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
<domain name="pgsql130"
6464
connectionUrl="postgresql://dotest:dotest@localhost:54130/dotest" />
6565

66+
<domain name="pgsql140"
67+
connectionUrl="postgresql://dotest:dotest@localhost:54140/dotest" />
68+
6669
<domain name="oracle10"
6770
connectionUrl="oracle://dotest:dotest@localhost:5510/ora10" />
6871

@@ -149,6 +152,9 @@
149152
<domain name="pgsql130cs" provider="postgresql"
150153
connectionString="HOST=localhost;PORT=54130;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
151154

155+
<domain name="pgsql140cs" provider="postgresql"
156+
connectionString="HOST=localhost;PORT=54140;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
157+
152158
<domain name="oracle10cs" provider="oracle"
153159
connectionString="DATA SOURCE=&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=5510))(CONNECT_DATA=(SERVICE_NAME=ora10)))&quot;;USER ID=dotest;PASSWORD=dotest" />
154160

Orm/Xtensive.Orm.Tests/Issues/IssueJira0117_FKStructureTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected override DomainConfiguration BuildConfiguration()
9696
public void AssociationThroughStructureTest()
9797
{
9898
var type = Domain.Model.Types[typeof (Owner1)];
99-
Assert.AreEqual(2, type.GetOwnerAssociations().Count);
99+
Assert.AreEqual(2, type.GetOwnerAssociations().Count());
100100
Assert.AreEqual(8, Domain.Model.Associations.Count);
101101
}
102102

Orm/Xtensive.Orm.Tests/Model/LibraryTest.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -393,34 +393,34 @@ protected override DomainConfiguration BuildConfiguration()
393393
private static void VerifyModel(Domain domain)
394394
{
395395
TypeInfoCollection types = domain.Model.Types;
396-
Assert.AreEqual(types.FindAncestor(types[typeof (Person)]), null);
397-
Assert.AreEqual(types.FindAncestor(types[typeof (Book)]), null);
398-
Assert.AreEqual(types.FindAncestor(types[typeof (BookReview)]), null);
399-
Assert.AreEqual(types.FindAncestor(types[typeof (Author)]), types[typeof (Person)]);
400-
401-
Assert.AreEqual(types[typeof (Person)].GetAncestor(), null);
402-
Assert.AreEqual(types[typeof (Book)].GetAncestor(), null);
403-
Assert.AreEqual(types[typeof (BookReview)].GetAncestor(), null);
404-
Assert.AreEqual(types[typeof (Author)].GetAncestor(), types[typeof (Person)]);
405-
406-
ICollection<TypeInfo> collection = types.Structures;
407-
Assert.IsTrue(collection.Count > 0);
396+
Assert.AreEqual(types[typeof (Person)].Ancestor, null);
397+
Assert.AreEqual(types[typeof (Book)].Ancestor, null);
398+
Assert.AreEqual(types[typeof (BookReview)].Ancestor, null);
399+
Assert.AreEqual(types[typeof (Author)].Ancestor, types[typeof (Person)]);
400+
401+
Assert.AreEqual(types[typeof (Person)].Ancestor, null);
402+
Assert.AreEqual(types[typeof (Book)].Ancestor, null);
403+
Assert.AreEqual(types[typeof (BookReview)].Ancestor, null);
404+
Assert.AreEqual(types[typeof (Author)].Ancestor, types[typeof (Person)]);
405+
406+
var collection = types.Structures;
407+
Assert.IsTrue(collection.Any());
408408
foreach (TypeInfo item in collection) {
409409
Assert.IsTrue(item.IsStructure);
410410
Assert.IsFalse(item.IsInterface);
411411
Assert.IsFalse(item.IsEntity);
412412
}
413413

414414
collection = types.Interfaces;
415-
Assert.IsFalse(collection.Count > 0);
415+
Assert.IsFalse(collection.Any());
416416
foreach (TypeInfo item in collection) {
417417
Assert.IsTrue(item.IsInterface);
418418
Assert.IsFalse(item.IsStructure);
419419
Assert.IsFalse(item.IsEntity);
420420
}
421421

422422
collection = types.Entities;
423-
Assert.IsTrue(collection.Count > 0);
423+
Assert.IsTrue(collection.Any());
424424
foreach (TypeInfo item in collection) {
425425
Assert.IsTrue(item.IsEntity);
426426
Assert.IsFalse(item.IsInterface);
@@ -555,8 +555,8 @@ private static void VerifyModel(Domain domain)
555555
Assert.AreEqual(true, typeInfo.Fields["Books"].IsNullable);
556556
Assert.AreEqual("Books", typeInfo.Fields["Books"].Name);
557557

558-
Assert.AreEqual(2, typeInfo.Fields.Find(FieldAttributes.Declared).Count);
559-
Assert.AreEqual(9, typeInfo.Fields.Find(FieldAttributes.Inherited).Count);
558+
Assert.AreEqual(2, typeInfo.Fields.Find(FieldAttributes.Declared).Count());
559+
Assert.AreEqual(9, typeInfo.Fields.Find(FieldAttributes.Inherited).Count());
560560

561561
// KeyColumns
562562
Assert.IsNotNull(typeInfo.Columns["PassportNumber"]);

Orm/Xtensive.Orm.Tests/Storage/Prefetch/PrefetchTestHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public static void AssertOnlySpecifiedColumnsAreLoaded(Key key, TypeInfo type, S
4242
var state = session.EntityStateCache[key, true];
4343
var realType = state.Key.TypeInfo;
4444
Assert.IsTrue(realType.Equals(type)
45-
|| realType.GetAncestors().Contains(type)
46-
|| (type.IsInterface && realType.GetInterfaces(true).Contains(type)));
45+
|| realType.Ancestors.Contains(type)
46+
|| (type.IsInterface && realType.AllInterfaces.Contains(type)));
4747
var tuple = state.Tuple;
4848
Assert.IsNotNull(tuple);
4949
foreach (var field in type.Fields) {

Orm/Xtensive.Orm.Tests/Storage/VersionBehaviorTest.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Created: 2010.08.05
66

77
using System;
8+
using System.Linq;
89
using System.Diagnostics;
910
using NUnit.Framework;
1011
using Xtensive.Orm.Tests;
@@ -186,8 +187,8 @@ public void DefaultTest()
186187
var domain = Domain.Build(config);
187188
var defaultTypeInfo = domain.Model.Types[typeof(Default)];
188189
var defaultInheritorTypeInfo = domain.Model.Types[typeof(DefaultInheritor)];
189-
Assert.AreEqual(3, defaultTypeInfo.GetVersionColumns().Count);
190-
Assert.AreEqual(4, defaultInheritorTypeInfo.GetVersionColumns().Count);
190+
Assert.AreEqual(3, defaultTypeInfo.GetVersionColumns().Count());
191+
Assert.AreEqual(4, defaultInheritorTypeInfo.GetVersionColumns().Count());
191192
using (var session = domain.OpenSession()) {
192193
var versions = new VersionSet();
193194
var updatedVersions = new VersionSet();
@@ -256,10 +257,10 @@ public void ManualTest()
256257
var anotherManualTypeInfo = domain.Model.Types[typeof(AnotherManual)];
257258
var manualInheritorTypeInfo = domain.Model.Types[typeof(ManualInheritor)];
258259
var anotherManualInheritorTypeInfo = domain.Model.Types[typeof(AnotherManualInheritor)];
259-
Assert.AreEqual(1, manualTypeInfo.GetVersionColumns().Count);
260-
Assert.AreEqual(2, anotherManualTypeInfo.GetVersionColumns().Count);
261-
Assert.AreEqual(1, manualInheritorTypeInfo.GetVersionColumns().Count);
262-
Assert.AreEqual(2, anotherManualInheritorTypeInfo.GetVersionColumns().Count);
260+
Assert.AreEqual(1, manualTypeInfo.GetVersionColumns().Count());
261+
Assert.AreEqual(2, anotherManualTypeInfo.GetVersionColumns().Count());
262+
Assert.AreEqual(1, manualInheritorTypeInfo.GetVersionColumns().Count());
263+
Assert.AreEqual(2, anotherManualInheritorTypeInfo.GetVersionColumns().Count());
263264
using (var session = domain.OpenSession()) {
264265
var versions = new VersionSet();
265266
var updatedVersions = new VersionSet();
@@ -322,8 +323,8 @@ public void AutoTest()
322323
var domain = Domain.Build(config);
323324
var autoTypeInfo = domain.Model.Types[typeof(Auto)];
324325
var autoInheritorTypeInfo = domain.Model.Types[typeof(AutoInheritor)];
325-
Assert.AreEqual(1, autoTypeInfo.GetVersionColumns().Count);
326-
Assert.AreEqual(2, autoInheritorTypeInfo.GetVersionColumns().Count);
326+
Assert.AreEqual(1, autoTypeInfo.GetVersionColumns().Count());
327+
Assert.AreEqual(2, autoInheritorTypeInfo.GetVersionColumns().Count());
327328
using (var session = domain.OpenSession()) {
328329
var versions = new VersionSet();
329330
var updatedVersions = new VersionSet();
@@ -400,9 +401,9 @@ public void SkipTest()
400401
var skipTypeInfo = domain.Model.Types[typeof(Skip)];
401402
var hasVersionTypeInfo = domain.Model.Types[typeof(HasVersion)];
402403
var hasSkipVersionTypeInfo = domain.Model.Types[typeof(HasSkipVersion)];
403-
Assert.AreEqual(2, skipTypeInfo.GetVersionColumns().Count);
404-
Assert.AreEqual(2, hasVersionTypeInfo.GetVersionColumns().Count);
405-
Assert.AreEqual(2, hasSkipVersionTypeInfo.GetVersionColumns().Count);
404+
Assert.AreEqual(2, skipTypeInfo.GetVersionColumns().Count());
405+
Assert.AreEqual(2, hasVersionTypeInfo.GetVersionColumns().Count());
406+
Assert.AreEqual(2, hasSkipVersionTypeInfo.GetVersionColumns().Count());
406407
using (var session = domain.OpenSession()) {
407408
var versions = new VersionSet();
408409
var updatedVersions = new VersionSet();

Orm/Xtensive.Orm.Tests/Xtensive.Orm.Tests.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@
1212
<WarningLevel>2</WarningLevel>
1313
</PropertyGroup>
1414
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
15+
<ItemGroup Condition="'$(TargetFramework)'=='net5.0'">
16+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
17+
</ItemGroup>
18+
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
19+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
20+
</ItemGroup>
1521
<ItemGroup>
1622
<!-- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> -->
1723
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
1824
<PackageReference Include="Npgsql" Version="4.1.3.1" />
1925
<PackageReference Include="NUnit" Version="3.13.2" />
2026
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
2127
<PackageReference Include="System.CodeDom" Version="4.4.0" />
22-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
2328
<PackageReference Include="System.Runtime.Serialization.Xml" Version="4.3.0" />
2429
<PackageReference Include="System.Spatial" Version="5.8.3" />
2530
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0.0" />

Orm/Xtensive.Orm/Collections/Interfaces/IFilterable.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ public interface IFilterable<TFilter, TItem>
2020
/// Finds the items from initial collection according to specified filter <paramref name="criteria"/>.
2121
/// </summary>
2222
/// <param name="criteria">The object to filter initial collection with.</param>
23-
/// <returns><see cref="ICollection{TItem}"/> object.</returns>
24-
ICollection<TItem> Find(TFilter criteria);
23+
/// <returns><see cref="IEnumerable{TItem}"/> object.</returns>
24+
IEnumerable<TItem> Find(TFilter criteria);
2525

2626
/// <summary>
2727
/// Finds the items from initial collection according to specified filter <paramref name="criteria"/>.
2828
/// </summary>
2929
/// <param name="criteria">The object to filter initial collection with.</param>
3030
/// <param name="matchType">Type of the match.</param>
31-
/// <returns><see cref="ICollection{TItem}"/> object.</returns>
32-
ICollection<TItem> Find(TFilter criteria, MatchType matchType);
31+
/// <returns><see cref="IEnumerable{TItem}"/> object.</returns>
32+
IEnumerable<TItem> Find(TFilter criteria, MatchType matchType);
3333
}
3434
}

0 commit comments

Comments
 (0)