Skip to content

Commit

Permalink
Merge pull request #234 from Avanade/feature/structV8
Browse files Browse the repository at this point in the history
wip(Liquid.Core, Liquid.WebApi.Http): Update Liquid framework for net8.
  • Loading branch information
lucianareginalino authored Jun 17, 2024
2 parents 14df2be + 365f20d commit fb0e649
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 29 deletions.
4 changes: 3 additions & 1 deletion src/Liquid.Core/Liquid.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Copyright>Avanade 2019</Copyright>
<PackageProjectUrl>https://github.com/Avanade/Liquid-Application-Framework</PackageProjectUrl>
<PackageIcon>logo.png</PackageIcon>
<Version>8.0.0-alpha-03</Version>
<Version>8.0.0-alpha-04</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProjectGuid>{C33A89FC-4F4D-4274-8D0F-29456BA8F76B}</ProjectGuid>
<IsPackable>true</IsPackable>
Expand All @@ -26,9 +26,11 @@
<PackageReference Include="MediatR" Version="12.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,5 @@ public LiquidContextKeysException(string contextKey) : base($"The value of requi
public LiquidContextKeysException(string message, Exception innerException) : base(message, innerException)
{
}

///<inheritdoc/>
protected LiquidContextKeysException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@ public LiquidScopedtKeysException(string message, Exception innerException) : ba
{
}

///<inheritdoc/>
protected LiquidScopedtKeysException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System.Diagnostics.CodeAnalysis;
using Liquid.Core.Interfaces;
using Liquid.WebApi.Http.Middlewares;
using Liquid.WebApi.Http.Middlewares;
using Liquid.WebApi.Http.Settings;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System.Diagnostics.CodeAnalysis;

namespace Liquid.WebApi.Http.Extensions.DependencyInjection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Liquid.Core.Extensions.DependencyInjection;
using Liquid.Core.Implementations;
using Liquid.Core.Interfaces;
using Liquid.Core.Settings;
using Liquid.WebApi.Http.Filters.Swagger;
using Liquid.WebApi.Http.Settings;
using Microsoft.Extensions.Configuration;
Expand All @@ -25,23 +26,47 @@ public static class IServiceCollectionExtensions
{
/// <summary>
/// Registers a <see cref="LiquidContext"/> service and execute registration methods
/// set mapping <see cref="IServiceCollectionAutoMapperExtensions.AddAutoMapper(IServiceCollection, Action{AutoMapper.IMapperConfigurationExpression}, Assembly[])"/>,
/// set mapping <see cref="IServiceCollectionAutoMapperExtensions.LiquidAddAutoMapper(IServiceCollection, Action{AutoMapper.IMapperConfigurationExpression}, Assembly[])"/>,
/// register domain handlers <see cref="IServiceCollectionCoreExtensions.AddLiquidHandlers(IServiceCollection, bool, bool, Assembly[])"/>,
/// and swagger <see cref="AddLiquidSwagger(IServiceCollection)"/>
/// </summary>
/// <param name="services">Extended service collection instance.</param>
/// <param name="assemblies">Array of assemblies that the domain handlers are implemented.</param>
/// <param name="sectionName">Swagger configuration section name.</param>
public static IServiceCollection AddLiquidHttp(this IServiceCollection services, string sectionName, params Assembly[] assemblies)
/// <param name="middlewares">Indicates if middlewares options must be binded.</param>
public static IServiceCollection AddLiquidHttp(this IServiceCollection services, string sectionName, bool middlewares = false, params Assembly[] assemblies)
{
if (middlewares)
{
services.AddOptions<ScopedContextSettings>()
.Configure<IConfiguration>((settings, configuration) =>
{
configuration.GetSection(sectionName + ":ScopedContext").Bind(settings);
});

services.AddOptions<CultureSettings>()
.Configure<IConfiguration>((settings, configuration) =>
{
configuration.GetSection(sectionName + ":Culture").Bind(settings);
});

services.AddOptions<ScopedLoggingSettings>()
.Configure<IConfiguration>((settings, configuration) =>
{
configuration.GetSection(sectionName + ":ScopedLogging").Bind(settings);
});
}

services.AddScoped<ILiquidContext, LiquidContext>();
services.AddLiquidSerializers();

services.AddOptions<SwaggerSettings>()
.Configure<IConfiguration>((settings, configuration) =>
{
configuration.GetSection(sectionName).Bind(settings);
configuration.GetSection(sectionName + ":Swagger").Bind(settings);
});
services.AddAutoMapper(assemblies);

services.LiquidAddAutoMapper(assemblies);
services.AddLiquidHandlers(true, true, assemblies);

services.AddLiquidSwagger();
Expand Down
9 changes: 3 additions & 6 deletions src/Liquid.WebApi.Http/Liquid.WebApi.Http.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PackageId>Liquid.WebApi.Http</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Authors>Avanade Brazil</Authors>
Expand All @@ -10,7 +10,7 @@
<Copyright>Avanade 2019</Copyright>
<PackageProjectUrl>https://github.com/Avanade/Liquid-Application-Framework</PackageProjectUrl>
<PackageIcon>logo.png</PackageIcon>
<Version>6.0.1</Version>
<Version>8.0.0-alpha-01</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<DebugType>Full</DebugType>
Expand All @@ -23,6 +23,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Liquid.Core" Version="8.0.0-alpha-03" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

Expand All @@ -33,8 +34,4 @@
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Liquid.Core\Liquid.Core.csproj" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions test/Liquid.WebApi.Http.Tests/Liquid.WebApi.Http.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit fb0e649

Please sign in to comment.