Skip to content

Commit

Permalink
Maintenance
Browse files Browse the repository at this point in the history
- Update dependencies
- Deprecate unsupported frameworks
  • Loading branch information
Yurii Zhoholiev committed Apr 1, 2024
1 parent 19cd5c5 commit 1289a9a
Show file tree
Hide file tree
Showing 62 changed files with 291 additions and 294 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class EventFlowJsonOptionsMvcConfiguration
#if NETSTANDARD2_0
: IConfigureOptions<MvcJsonOptions>
#endif
#if (NETCOREAPP3_0 || NETCOREAPP3_1)
#if NET6_0_OR_GREATER
: IConfigureOptions<MvcNewtonsoftJsonOptions>
#endif
{
Expand All @@ -48,7 +48,7 @@ public void Configure(MvcJsonOptions options)
_jsonOptions.Apply(options.SerializerSettings);
}
#endif
#if (NETCOREAPP3_0 || NETCOREAPP3_1)
#if NET6_0_OR_GREATER
public void Configure(MvcNewtonsoftJsonOptions options)
{
_jsonOptions.Apply(options.SerializerSettings);
Expand Down
23 changes: 10 additions & 13 deletions Source/EventFlow.AspNetCore/EventFlow.AspNetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
Expand All @@ -21,21 +21,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.5" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.3" />
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.28" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.6" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public AspNetCoreEventFlowOptions UseMvcJsonOptions()
return this;
}
#endif
#if (NETCOREAPP3_0 || NETCOREAPP3_1)
#if NET6_0_OR_GREATER
public AspNetCoreEventFlowOptions UseMvcJsonOptions()
{
_options.RegisterServices(s =>
Expand Down
11 changes: 4 additions & 7 deletions Source/EventFlow.Autofac.Tests/EventFlow.Autofac.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IsPackable>False</IsPackable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EventFlow.Autofac\EventFlow.Autofac.csproj" />
Expand Down
18 changes: 3 additions & 15 deletions Source/EventFlow.Autofac/EventFlow.Autofac.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Common.props" />
<PropertyGroup>
<TargetFrameworks>net452;netstandard1.6;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
Expand All @@ -20,22 +20,10 @@
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<PackageReference Include="Autofac" Version="3.5.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
<PackageReference Include="Autofac" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Autofac" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Autofac" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\EventFlow\EventFlow.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
Expand All @@ -20,10 +20,16 @@
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IsPackable>False</IsPackable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EventFlow.Elasticsearch\EventFlow.Elasticsearch.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private IEnumerable<Type> GetLoadableTypes<T>(params Assembly[] assemblies)
{
IEnumerable<Type> availableTypes;

if (assemblies == null || !assemblies.Any()) throw new ArgumentNullException(nameof(assemblies));
if (assemblies == null || assemblies.Length == 0) throw new ArgumentNullException(nameof(assemblies));
try
{
availableTypes = assemblies.SelectMany(x => x.GetTypes());
Expand Down
7 changes: 3 additions & 4 deletions Source/EventFlow.Elasticsearch/EventFlow.Elasticsearch.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Common.props" />
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
Expand All @@ -21,9 +21,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="NEST" Version="7.8.2" />
<PackageReference Include="newtonsoft.json" Version="11.0.2" />
<PackageReference Include="NEST" Version="7.17.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Npgsql" Version="4.1.3.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Npgsql" Version="8.0.2" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ public class InMemoryDbContextProvider : IDbContextProvider<TestDbContext>

public InMemoryDbContextProvider()
{
#pragma warning disable EF1001
_options = new DbContextOptionsBuilder<TestDbContext>()
.UseInMemoryDatabase("EventFlowTest")
.ReplaceService<IInMemoryTableFactory, IndexingInMemoryTableFactory>()
#pragma warning restore EF1001
.Options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.InMemory.Storage.Internal;
using Microsoft.EntityFrameworkCore.InMemory.ValueGeneration.Internal;
using Microsoft.EntityFrameworkCore.Metadata;
Expand All @@ -44,15 +45,15 @@ public IndexingInMemoryTable(IInMemoryTable innerTable, IIndex[] indexDefinition
{
_innerTable = innerTable;
_indexDefinitions = indexDefinitions;
_indexes = _indexDefinitions.Select(i => new HashSet<IndexEntry>()).ToArray();
_indexes = _indexDefinitions.Select(_ => new HashSet<IndexEntry>()).ToArray();
}

public IReadOnlyList<object[]> SnapshotRows()
{
return _innerTable.SnapshotRows();
}

public void Create(IUpdateEntry entry)
public void Create(IUpdateEntry entry, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
{
var indexEntries = _indexDefinitions
.Select(d => d.Properties.Select(entry.GetCurrentValue).ToArray())
Expand All @@ -62,34 +63,37 @@ public void Create(IUpdateEntry entry)
if (indexEntries.Select((item, i) => _indexes[i].Contains(item)).Any(contains => contains))
throw new DbUpdateException("Error while updating.", new Exception("Unique constraint violated."));

_innerTable.Create(entry);
_innerTable.Create(entry, updateLogger);

indexEntries.Select((item, i) => _indexes[i].Add(item)).ToArray();
}

public void Delete(IUpdateEntry entry)
public void Delete(IUpdateEntry entry, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
{
_innerTable.Delete(entry);
_innerTable.Delete(entry, updateLogger);
}

public void Update(IUpdateEntry entry)
public void Update(IUpdateEntry entry, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
{
_innerTable.Update(entry);
_innerTable.Update(entry, updateLogger);
}

public InMemoryIntegerValueGenerator<TProperty> GetIntegerValueGenerator<TProperty>(IProperty property)
public InMemoryIntegerValueGenerator<TProperty> GetIntegerValueGenerator<TProperty>(IProperty property, IReadOnlyList<IInMemoryTable> tables)
{
return _innerTable.GetIntegerValueGenerator<TProperty>(property);
return _innerTable.GetIntegerValueGenerator<TProperty>(property, tables);
}

private struct IndexEntry
public void BumpValueGenerators(object[] row)
{
private readonly object[] _values;
_innerTable.BumpValueGenerators(row);
}

public IndexEntry(object[] values)
{
_values = values;
}
public IEnumerable<object[]> Rows => _innerTable.Rows;
public IInMemoryTable BaseTable => _innerTable.BaseTable;

private readonly struct IndexEntry(object[] values)
{
private readonly object[] _values = values;

public bool Equals(IndexEntry other)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

using System.Linq;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.InMemory.Infrastructure.Internal;
using Microsoft.EntityFrameworkCore.InMemory.Storage.Internal;
using Microsoft.EntityFrameworkCore.Metadata;

Expand All @@ -31,13 +32,13 @@ namespace EventFlow.EntityFramework.Tests.InMemory.Infrastructure
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "EF1001:Internal EF Core API usage.", Justification = "Only for test")]
public class IndexingInMemoryTableFactory : InMemoryTableFactory
{
public IndexingInMemoryTableFactory(ILoggingOptions loggingOptions) : base(loggingOptions)
public IndexingInMemoryTableFactory(ILoggingOptions loggingOptions, IInMemorySingletonOptions options) : base(loggingOptions, options)
{
}

public override IInMemoryTable Create(IEntityType entityType)
public override IInMemoryTable Create(IEntityType entityType, IInMemoryTable baseTable)
{
var innerTable = base.Create(entityType);
var innerTable = base.Create(entityType, baseTable);
var uniqueIndexes = entityType.GetIndexes().Where(i => i.IsUnique).ToArray();

return uniqueIndexes.Any()
Expand Down

0 comments on commit 1289a9a

Please sign in to comment.