Skip to content

Commit

Permalink
Refactored code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahara committed Dec 11, 2023
1 parent edaf5c1 commit 0f11622
Show file tree
Hide file tree
Showing 52 changed files with 836 additions and 696 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ Breaking Changes:
- Upgraded [Castle.Facilities.AutoTx] version to 5.3.0
- Replaced ```Castle.Services.Transaction.TransactionMode``` with ```System.Transactions.TransactionScopeOption```
- Replaced ```Castle.Services.Transaction.IsolationMode``` with ```System.Transactions.IsolationLevel```
- Refactored ```AbstractDictionaryStackSessionStore```
- Refactored ```Castle.Facilities.NHibernateIntegration.SessionStores.AbstractDictionaryStackSessionStore```


## 5.2.0 (2022-06-25)

Improvements:
- Added ```AsyncLocalSessionStore```
- Added ```Castle.Facilities.NHibernateIntegration.SessionStores.AsyncLocalSessionStore```
- Updated [Castle.Windsor] version to 5.1.2
- Updated [Castle.Services.Transaction] version to 5.2.0
- Updated [Castle.Facilities.AutoTx] version to 5.2.0

Breaking Changes:
- Set ```AsyncLocalSessionStore``` as the default ```SessionStore```
- Set ```Castle.Facilities.NHibernateIntegration.SessionStores.AsyncLocalSessionStore``` as the default ```SessionStore``` in ```Castle.Facilities.NHibernateIntegration.NHibernateFacility.DefaultSessionStoreType```


## 5.1.0 (2022-02-20)
Expand Down
8 changes: 3 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
<PackageVersion Include="Castle.Services.Transaction" Version="[5.4,5.5)" />
<PackageVersion Include="Castle.Windsor" Version="[5.1.2,6)" />
<PackageVersion Include="DotNetZip" Version="1.16.0" />
<PackageVersion Include="IndexRange" Version="1.0.3" />
<PackageVersion Include="LiquidTestReports.Markdown" Version="1.0.9" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.8.0" />
<PackageVersion Include="Moq" Version="4.17.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NHibernate" Version="[5.4,6)" />
<PackageVersion Include="Nullable" Version="1.3.1" />
<PackageVersion Include="NUnit" Version="4.0.1" />
<PackageVersion Include="NUnit.Analyzers" Version="3.10.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
Expand All @@ -28,9 +31,4 @@
<PackageVersion Include="System.Data.SqlClient" Version="4.8.5" />
<PackageVersion Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0'">
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<PackageVersion Include="IndexRange" Version="1.0.3" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# ****************************************************************************
# Copyright 2004-2022 Castle Project - https://www.castleproject.org/
# Copyright 2004-2024 Castle Project - https://www.castleproject.org/
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
2 changes: 0 additions & 2 deletions buildscripts/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// limitations under the License.
#endregion

using System;

[assembly: CLSCompliant(true)]


Expand Down
4 changes: 2 additions & 2 deletions buildscripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>

<LangVersion>latest</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public virtual void TearDown()
OnTearDown();
DropDatabaseSchemas();
Container.Dispose();
Container = null;
Container = null!;
}

protected virtual void OnTearDown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,31 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Core" />
<PackageReference Include="Castle.Facilities.AutoTx" />
<PackageReference Include="Castle.LoggingFacility" />
<PackageReference Include="Castle.Services.Transaction" />
<PackageReference Include="Castle.Windsor" />
<PackageReference Include="LiquidTestReports.Markdown" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />
<PackageReference Include="Moq" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NHibernate" />
<PackageReference Include="NUnit" />
<PackageReference Include="Castle.Core" />
<PackageReference Include="Castle.Facilities.AutoTx" />
<PackageReference Include="Castle.LoggingFacility" />
<PackageReference Include="Castle.Services.Transaction" />
<PackageReference Include="Castle.Windsor" />
<PackageReference Include="LiquidTestReports.Markdown" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />
<PackageReference Include="Moq" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NHibernate" />
<PackageReference Include="Nullable">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="NUnitLite" />
<PackageReference Include="NunitXml.TestLogger" />
<PackageReference Include="System.Data.SqlClient" />
<PackageReference Include="System.Text.Json" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="NUnitLite" />
<PackageReference Include="NunitXml.TestLogger" />
<PackageReference Include="System.Data.SqlClient" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Blog()

public virtual int Id { get; set; }

public virtual string Name { get; set; }
public virtual string Name { get; set; } = string.Empty;

public virtual IList<BlogItem> Items { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public class BlogItem
{
public virtual int Id { get; set; }

public virtual Blog ParentBlog { get; set; }
public virtual Blog? ParentBlog { get; set; }

public virtual string Title { get; set; }
public virtual string Title { get; set; } = string.Empty;

public virtual string Text { get; set; }
public virtual string Text { get; set; } = string.Empty;

public virtual DateTime DateTime { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class BlogRef
{
public virtual int Id { get; set; }

public virtual Blog ParentBlog { get; set; }
public virtual Blog? ParentBlog { get; set; }

public virtual string Title { get; set; }
public virtual string Title { get; set; } = string.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ public void ResetState()

#region IInterceptor Members

public override int[] FindDirty(object entity,
object id,
object[] currentState,
object[] previousState,
string[] propertyNames,
IType[] types)
public override int[]? FindDirty(object entity,
object id,
object[] currentState,
object[] previousState,
string[] propertyNames,
IType[] types)
{
return null;
}

public override object Instantiate(string clazz, object id)
public override object? Instantiate(string clazz, object id)
{
_instantiationCall = true;

Expand Down
Loading

0 comments on commit 0f11622

Please sign in to comment.