Skip to content

Commit

Permalink
Merge pull request #33 from alistairjevans/feature/v7-upgrade
Browse files Browse the repository at this point in the history
Update Autofac.Multitenant for Autofac v7 support
  • Loading branch information
tillig authored Mar 8, 2023
2 parents 5d25233 + 67d7834 commit 8406963
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
image: Ubuntu

version: '6.0.0.{build}'
version: '7.0.0.{build}'

dotnet_csproj:
version_prefix: '6.0.0'
version_prefix: '7.0.0'
patch: true
file: 'src\**\*.csproj'

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.402",
"version": "7.0.101",
"rollForward": "latestFeature"
}
}
4 changes: 2 additions & 2 deletions src/Autofac.Multitenant/Autofac.Multitenant.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>Autofac extension for multitenant application support.</Description>
<!-- VersionPrefix patched by AppVeyor -->
<VersionPrefix>0.0.1</VersionPrefix>
<TargetFrameworks>netstandard2.0;netstandard2.1;</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Autofac.Multitenant</AssemblyName>
Expand Down Expand Up @@ -41,7 +41,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="6.0.0" />
<PackageReference Include="Autofac" Version="7.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.6.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Expand Down
17 changes: 17 additions & 0 deletions src/Autofac.Multitenant/MultitenantContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
#if NET5_0_OR_GREATER
using System.Runtime.Loader;
#endif
using System.Threading.Tasks;
using Autofac.Core;
using Autofac.Core.Lifetime;
Expand Down Expand Up @@ -299,6 +302,20 @@ public ILifetimeScope BeginLifetimeScope(object tag, Action<ContainerBuilder> co
return this.GetCurrentTenantScope().BeginLifetimeScope(tag, configurationAction);
}

#if NET5_0_OR_GREATER
/// <inheritdoc />
public ILifetimeScope BeginLoadContextLifetimeScope(AssemblyLoadContext loadContext, Action<ContainerBuilder> configurationAction)
{
return this.GetCurrentTenantScope().BeginLoadContextLifetimeScope(loadContext, configurationAction);
}

/// <inheritdoc />
public ILifetimeScope BeginLoadContextLifetimeScope(object tag, AssemblyLoadContext loadContext, Action<ContainerBuilder> configurationAction)
{
return this.GetCurrentTenantScope().BeginLoadContextLifetimeScope(tag, loadContext, configurationAction);
}
#endif

/// <summary>
/// Allows configuration of tenant-specific components. You may only call this
/// method if the tenant is not currently configured.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591;SA1602;SA1611</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Autofac.Multitenant.AspNetCore.Test</AssemblyName>
Expand All @@ -22,12 +22,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.0.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
<PackageReference Include="coverlet.msbuild" Version="2.9.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591;SA1602;SA1611</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Autofac.Multitenant.Test</AssemblyName>
Expand Down

0 comments on commit 8406963

Please sign in to comment.