Skip to content

Commit 3cd78c1

Browse files
committed
Merge branch 'master' into master-typeid-as-parameter
# Conflicts: # Orm/Xtensive.Orm/Orm/Configuration/DomainConfiguration.cs
2 parents d06215f + 166a892 commit 3cd78c1

File tree

61 files changed

+3222
-1334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3222
-1334
lines changed

ChangeLog/7.1.0-Beta-2-dev.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
[main] SqlCustomFunctionCall and SqlFunctionCall share one base type
1313
[main] SqlFunctionCall.Arguments property is IReadOnlyList now and parameters can't be changed after instance creation
1414
[main] Xtensive.Sql.Dml.Extensions.IsNullReference() extension method is marked obsolete, use 'is null' operator instead
15+
[main] DirectSessionAccessor.GetChangedEntities() result type changed to improve enumeration
16+
[main] EntityChangeRegistry.GetItems(PersistenceState) changed result type to improve enumeration
17+
[main] EntitySetChangeRegistry.GetItems() changed result type to improve enumeration
18+
[main] IgnoreRule now has only one public constructor - parameterless
19+
[main] IgnoreRule supports indexes
1520
[main] BitFaster.Caching package reference is updated to 1.0.7
1621
[main] No error caused by ambiguity due to new IQueryable extension methods of .Net 6
1722
[reprocessing] DomainBuildErrorEventArgs (not sealed) became read-only structure

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/App.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,22 @@
125125
<ignoreRules>
126126
<rule database="Other-DO40-Tests" schema="some-schema1" table="table1"/>
127127
<rule database="some-database" schema="some-schema2" column="column2"/>
128+
<rule database="some-database" schema="some-schema2" index="index2"/>
128129
<rule database="some-database" schema="some-schema3" table="table2" column="col3"/>
130+
<rule database="some-database" schema="some-schema3" table="table2" index="index3"/>
129131
<rule database="another-some-database" table="some-table" />
130132
<rule database="database1" column ="some-column"/>
133+
<rule database="database1" index ="some-index"/>
131134
<rule schema="schema1" table="table1"/>
132135
<rule schema="schema1" column="column2"/>
136+
<rule schema="schema1" index="index2" />
133137
<rule schema="schema1" table="table2" column="column3"/>
138+
<rule schema="schema1" table="table2" index="index3"/>
134139
<rule table="table4" column="column3"/>
140+
<rule table="table4" index ="index2" />
135141
<rule table="single-table"/>
136142
<rule column="single-column"/>
143+
<rule index ="single-index" />
137144
</ignoreRules>
138145
<databases>
139146
<database name="main" realName="DO40-Tests" />

Orm/Xtensive.Orm.Tests/Configuration/AppConfigTest.cs

Lines changed: 131 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ public void IgnoreRuleConfigTest()
203203

204204
var good = configuration.Clone();
205205
good.IgnoreRules.Clear();
206-
good.IgnoreRules.IgnoreTable("ignored-table").WhenDatabase("Other-DO40-Test").WhenSchema("dbo");
207-
good.IgnoreRules.IgnoreColumn("ignored-column");
206+
_ = good.IgnoreRules.IgnoreTable("ignored-table").WhenDatabase("Other-DO40-Test").WhenSchema("dbo");
207+
_ = good.IgnoreRules.IgnoreColumn("ignored-column");
208208
good.Lock();
209209
}
210210

@@ -382,13 +382,136 @@ private void ValidateIgnoringConfiguration(DomainConfiguration configuration)
382382
{
383383
Assert.That(configuration.DefaultDatabase, Is.EqualTo("main"));
384384
Assert.That(configuration.DefaultSchema, Is.EqualTo("dbo"));
385-
Assert.That(configuration.IgnoreRules.Count, Is.EqualTo(11));
386-
var rule = configuration.IgnoreRules[0];
385+
386+
var rules = configuration.IgnoreRules;
387+
Assert.That(rules.Count, Is.EqualTo(18));
388+
389+
var rule = rules[0];
387390
Assert.That(rule.Database, Is.EqualTo("Other-DO40-Tests"));
388-
var rule2 = configuration.IgnoreRules[2];
389-
Assert.That(rule2.Schema, Is.EqualTo("some-schema3"));
390-
Assert.That(rule2.Table, Is.EqualTo("table2"));
391-
Assert.That(rule2.Column, Is.EqualTo("col3"));
391+
Assert.That(rule.Schema, Is.EqualTo("some-schema1"));
392+
Assert.That(rule.Table, Is.EqualTo("table1"));
393+
Assert.That(rule.Column, Is.Null.Or.Empty);
394+
Assert.That(rule.Index, Is.Null.Or.Empty);
395+
396+
rule = rules[1];
397+
Assert.That(rule.Database, Is.EqualTo("some-database"));
398+
Assert.That(rule.Schema, Is.EqualTo("some-schema2"));
399+
Assert.That(rule.Table, Is.Null.Or.Empty);
400+
Assert.That(rule.Column, Is.EqualTo("column2"));
401+
Assert.That(rule.Index, Is.Null.Or.Empty);
402+
403+
rule = rules[2];
404+
Assert.That(rule.Database, Is.EqualTo("some-database"));
405+
Assert.That(rule.Schema, Is.EqualTo("some-schema2"));
406+
Assert.That(rule.Table, Is.Null.Or.Empty);
407+
Assert.That(rule.Column, Is.Null.Or.Empty);
408+
Assert.That(rule.Index, Is.EqualTo("index2"));
409+
410+
rule = rules[3];
411+
Assert.That(rule.Database, Is.EqualTo("some-database"));
412+
Assert.That(rule.Schema, Is.EqualTo("some-schema3"));
413+
Assert.That(rule.Table, Is.EqualTo("table2"));
414+
Assert.That(rule.Column, Is.EqualTo("col3"));
415+
Assert.That(rule.Index, Is.Null.Or.Empty);
416+
417+
rule = rules[4];
418+
Assert.That(rule.Database, Is.EqualTo("some-database"));
419+
Assert.That(rule.Schema, Is.EqualTo("some-schema3"));
420+
Assert.That(rule.Table, Is.EqualTo("table2"));
421+
Assert.That(rule.Column, Is.Null.Or.Empty);
422+
Assert.That(rule.Index, Is.EqualTo("index3"));
423+
424+
rule = rules[5];
425+
Assert.That(rule.Database, Is.EqualTo("another-some-database"));
426+
Assert.That(rule.Schema, Is.Null.Or.Empty);
427+
Assert.That(rule.Table, Is.EqualTo("some-table"));
428+
Assert.That(rule.Column, Is.Null.Or.Empty);
429+
Assert.That(rule.Index, Is.Null.Or.Empty);
430+
431+
rule = rules[6];
432+
Assert.That(rule.Database, Is.EqualTo("database1"));
433+
Assert.That(rule.Schema, Is.Null.Or.Empty);
434+
Assert.That(rule.Table, Is.Null.Or.Empty);
435+
Assert.That(rule.Column, Is.EqualTo("some-column"));
436+
Assert.That(rule.Index, Is.Null.Or.Empty);
437+
438+
rule = rules[7];
439+
Assert.That(rule.Database, Is.EqualTo("database1"));
440+
Assert.That(rule.Schema, Is.Null.Or.Empty);
441+
Assert.That(rule.Table, Is.Null.Or.Empty);
442+
Assert.That(rule.Column, Is.Null.Or.Empty);
443+
Assert.That(rule.Index, Is.EqualTo("some-index"));
444+
445+
rule = rules[8];
446+
Assert.That(rule.Database, Is.Null.Or.Empty);
447+
Assert.That(rule.Schema, Is.EqualTo("schema1"));
448+
Assert.That(rule.Table, Is.EqualTo("table1"));
449+
Assert.That(rule.Column, Is.Null.Or.Empty);
450+
Assert.That(rule.Index, Is.Null.Or.Empty);
451+
452+
rule = rules[9];
453+
Assert.That(rule.Database, Is.Null.Or.Empty);
454+
Assert.That(rule.Schema, Is.EqualTo("schema1"));
455+
Assert.That(rule.Table, Is.Null.Or.Empty);
456+
Assert.That(rule.Column, Is.EqualTo("column2"));
457+
Assert.That(rule.Index, Is.Null.Or.Empty);
458+
459+
rule = rules[10];
460+
Assert.That(rule.Database, Is.Null.Or.Empty);
461+
Assert.That(rule.Schema, Is.EqualTo("schema1"));
462+
Assert.That(rule.Table, Is.Null.Or.Empty);
463+
Assert.That(rule.Column, Is.Null.Or.Empty);
464+
Assert.That(rule.Index, Is.EqualTo("index2"));
465+
466+
rule = rules[11];
467+
Assert.That(rule.Database, Is.Null.Or.Empty);
468+
Assert.That(rule.Schema, Is.EqualTo("schema1"));
469+
Assert.That(rule.Table, Is.EqualTo("table2"));
470+
Assert.That(rule.Column, Is.EqualTo("column3"));
471+
Assert.That(rule.Index, Is.Null.Or.Empty);
472+
473+
rule = rules[12];
474+
Assert.That(rule.Database, Is.Null.Or.Empty);
475+
Assert.That(rule.Schema, Is.EqualTo("schema1"));
476+
Assert.That(rule.Table, Is.EqualTo("table2"));
477+
Assert.That(rule.Column, Is.Null.Or.Empty);
478+
Assert.That(rule.Index, Is.EqualTo("index3"));
479+
480+
rule = rules[13];
481+
Assert.That(rule.Database, Is.Null.Or.Empty);
482+
Assert.That(rule.Schema, Is.Null.Or.Empty);
483+
Assert.That(rule.Table, Is.EqualTo("table4"));
484+
Assert.That(rule.Column, Is.EqualTo("column3"));
485+
Assert.That(rule.Index, Is.Null.Or.Empty);
486+
487+
rule = rules[14];
488+
Assert.That(rule.Database, Is.Null.Or.Empty);
489+
Assert.That(rule.Schema, Is.Null.Or.Empty);
490+
Assert.That(rule.Table, Is.EqualTo("table4"));
491+
Assert.That(rule.Column, Is.Null.Or.Empty);
492+
Assert.That(rule.Index, Is.EqualTo("index2"));
493+
494+
rule = rules[15];
495+
Assert.That(rule.Database, Is.Null.Or.Empty);
496+
Assert.That(rule.Schema, Is.Null.Or.Empty);
497+
Assert.That(rule.Table, Is.EqualTo("single-table"));
498+
Assert.That(rule.Column, Is.Null.Or.Empty);
499+
Assert.That(rule.Index, Is.Null.Or.Empty);
500+
501+
rule = rules[16];
502+
Assert.That(rule.Database, Is.Null.Or.Empty);
503+
Assert.That(rule.Schema, Is.Null.Or.Empty);
504+
Assert.That(rule.Table, Is.Null.Or.Empty);
505+
Assert.That(rule.Column, Is.EqualTo("single-column"));
506+
Assert.That(rule.Index, Is.Null.Or.Empty);
507+
508+
rule = rules[17];
509+
Assert.That(rule.Database, Is.Null.Or.Empty);
510+
Assert.That(rule.Schema, Is.Null.Or.Empty);
511+
Assert.That(rule.Table, Is.Null.Or.Empty);
512+
Assert.That(rule.Column, Is.Null.Or.Empty);
513+
Assert.That(rule.Index, Is.EqualTo("single-index"));
514+
392515
var databases = configuration.Databases;
393516
Assert.That(databases.Count, Is.EqualTo(2));
394517
Assert.That(databases[0].Name, Is.EqualTo("main"));

0 commit comments

Comments
 (0)