Skip to content

Commit 2ff8bcf

Browse files
committed
Define constant DO_SAFE_COLLECTION_WRAPPER by default
1 parent 7dd7d9c commit 2ff8bcf

File tree

10 files changed

+13
-41
lines changed

10 files changed

+13
-41
lines changed

Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,10 @@
9696
</ItemGroup>
9797

9898
<Import Condition="Exists('User.Directory.Build.props')" Project="User.Directory.Build.props" />
99+
100+
<PropertyGroup>
101+
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
102+
<DefineConstants Condition="'$(Configuration)'=='Debug'">$(DefineConstants);DEBUG</DefineConstants>
103+
<DefineConstants Condition="'$(DO_SAFE_COLLECTION_WRAPPER)'!='false'">$(DefineConstants);DO_SAFE_COLLECTION_WRAPPER</DefineConstants>
104+
</PropertyGroup>
99105
</Project>

Extensions/Xtensive.Orm.Tracking/Internals/SessionTrackingMonitor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ private void OnPersisting(object sender, EventArgs e)
5555
{
5656
var frame = stack.Peek();
5757

58-
foreach (var state in accessor.GetChangedEntitiesInternal(PersistenceState.Removed))
58+
foreach (var state in accessor.GetChangedEntities(PersistenceState.Removed))
5959
frame.Register(new TrackingItem(state.Key, TrackingItemState.Deleted, state.DifferentialTuple));
6060

61-
foreach (var state in accessor.GetChangedEntitiesInternal(PersistenceState.New))
61+
foreach (var state in accessor.GetChangedEntities(PersistenceState.New))
6262
frame.Register(new TrackingItem(state.Key, TrackingItemState.Created, state.DifferentialTuple));
6363

64-
foreach (var state in accessor.GetChangedEntitiesInternal(PersistenceState.Modified))
64+
foreach (var state in accessor.GetChangedEntities(PersistenceState.Modified))
6565
frame.Register(new TrackingItem(state.Key, TrackingItemState.Changed, state.DifferentialTuple));
6666
}
6767

Orm/Xtensive.Orm.Manual/Xtensive.Orm.Manual.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1212
<WarningLevel>2</WarningLevel>
1313
</PropertyGroup>
14-
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
15-
<DefineConstants>TRACE;DEBUG</DefineConstants>
16-
</PropertyGroup>
17-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
18-
<DefineConstants>TRACE</DefineConstants>
19-
</PropertyGroup>
2014
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
2115
<ItemGroup>
2216
<ProjectReference Include="..\Xtensive.Orm.Tests.Framework\Xtensive.Orm.Tests.Framework.csproj" />

Orm/Xtensive.Orm.PostgreSql/Xtensive.Orm.PostgreSql.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1515
<WarningLevel>2</WarningLevel>
1616
</PropertyGroup>
17-
<PropertyGroup Label="Debug" Condition="'$(Configuration)'=='Debug'">
18-
<DefineConstants>TRACE;DEBUG</DefineConstants>
19-
</PropertyGroup>
20-
<PropertyGroup Label="Release" Condition="'$(Configuration)'=='Release'">
21-
<DefineConstants>TRACE</DefineConstants>
22-
</PropertyGroup>
2317
<ItemGroup>
2418
<PackageReference Include="Npgsql" Version="4.1.3.1" />
2519
</ItemGroup>

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1111
<WarningLevel>2</WarningLevel>
1212
</PropertyGroup>
13-
<PropertyGroup Label="Debug" Condition="'$(Configuration)'=='Debug'">
14-
<DefineConstants>TRACE;DEBUG</DefineConstants>
15-
</PropertyGroup>
16-
<PropertyGroup Label="Release" Condition="'$(Configuration)'=='Release'">
17-
<DefineConstants>TRACE</DefineConstants>
18-
</PropertyGroup>
1913
<ItemGroup>
2014
<ProjectReference Include="..\Xtensive.Orm.Tests.Framework\Xtensive.Orm.Tests.Framework.csproj" />
2115
<ProjectReference Include="..\Xtensive.Orm\Xtensive.Orm.csproj" />
@@ -26,5 +20,5 @@
2620
<PackageReference Include="NUnit" Version="3.13.2" />
2721
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
2822
</ItemGroup>
29-
23+
3024
</Project>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
44
<IsPackable>false</IsPackable>
5-
<DefineConstants>TRACE</DefineConstants>
65
</PropertyGroup>
76
<PropertyGroup>
87
<RootNamespace>Xtensive</RootNamespace>

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1111
<WarningLevel>2</WarningLevel>
1212
</PropertyGroup>
13-
<PropertyGroup Label="Debug" Condition="'$(Configuration)'=='Debug'">
14-
<DefineConstants>TRACE;DEBUG</DefineConstants>
15-
</PropertyGroup>
16-
<PropertyGroup Label="Release" Condition="'$(Configuration)'=='Release'">
17-
<DefineConstants>TRACE</DefineConstants>
18-
</PropertyGroup>
1913
<ItemGroup>
2014
<!-- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> -->
2115
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />

Orm/Xtensive.Orm/Orm/Services/DirectSessionAccessor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ public IDisposable NullifySessionTransaction()
7777
/// <param name="persistenceState">Type of entity change.</param>
7878
/// <returns><see cref="EntityState"/>s with the specified <paramref name="persistenceState"/>.</returns>
7979
public IEnumerable<EntityState> GetChangedEntities(PersistenceState persistenceState) =>
80+
#if DO_SAFE_COLLECTION_WRAPPER
8081
Session.EntityChangeRegistry.GetItems(persistenceState);
81-
82-
internal IEnumerable<EntityState> GetChangedEntitiesInternal(PersistenceState persistenceState) =>
82+
#else
8383
Session.EntityChangeRegistry.GetContainer(persistenceState);
84+
#endif
8485

8586
// Constructors
8687

Orm/Xtensive.Orm/Properties/Visibility.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,3 @@
3030
"f37c6a033d1a2a5354fc97226fc469128e49e6a479ac5d1dd69d7da5607d0dc4ede0765d477745" +
3131
"1034dc3a15f1532d010db3e633e62fc5e67a3ed175457acb9dc6c9d39ccc8ecfdaae62df34d488" +
3232
"c45009b2")]
33-
[assembly: InternalsVisibleTo("Xtensive.Orm.Tracking, PublicKey=" +
34-
"00240000048000009400000006020000002400005253413100040000010001007f8790a0573a2a" +
35-
"4f7b77907240977b669d33774bcaef77ef39d5186de4d4c836623fb661be674c7db731bc376184" +
36-
"f6848fc6b64eeba506654c8212de624e9d1f15ad1fe765f769e9a5b59ecaab2866632a983e7828" +
37-
"f3bf20ff7afffa021951cf8adc9ac1e786716430b0637893fb71b7566405fe14acc5e340c4af4a" +
38-
"a293c994")]

Orm/Xtensive.Orm/Xtensive.Orm.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
<WarningLevel>4</WarningLevel>
1616
<NoWarn>1591</NoWarn>
1717
</PropertyGroup>
18-
<PropertyGroup Label="Debug" Condition="'$(Configuration)'=='Debug'">
19-
<DefineConstants>TRACE;DEBUG</DefineConstants>
20-
</PropertyGroup>
2118
<PropertyGroup Label="Release" Condition="'$(Configuration)'=='Release'">
2219
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludeWeaverFiles</TargetsForTfmSpecificContentInPackage>
23-
<DefineConstants>TRACE</DefineConstants>
2420
<DebugSymbols>true</DebugSymbols>
2521
<DebugType>portable</DebugType>
2622
</PropertyGroup>

0 commit comments

Comments
 (0)