diff --git a/src/Wemogy.Infrastructure.Database.sln b/src/Wemogy.Infrastructure.Database.sln index 73bd809..b33f7a1 100644 --- a/src/Wemogy.Infrastructure.Database.sln +++ b/src/Wemogy.Infrastructure.Database.sln @@ -21,8 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wemogy.Infrastructure.Datab EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wemogy.Infrastructure.Database.InMemory.UnitTests", "in-memory\Wemogy.Infrastructure.Database.InMemory.UnitTests\Wemogy.Infrastructure.Database.InMemory.UnitTests.csproj", "{61AB84FA-D4F6-4B78-8E82-6749A3EC9C1C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wemogy.Core", "..\..\libs\helpers\src\Wemogy.Core\Wemogy.Core.csproj", "{44DFE52E-543B-45A7-823D-F05DB3E1A3BA}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -108,18 +106,6 @@ Global {61AB84FA-D4F6-4B78-8E82-6749A3EC9C1C}.Release|x64.Build.0 = Release|Any CPU {61AB84FA-D4F6-4B78-8E82-6749A3EC9C1C}.Release|x86.ActiveCfg = Release|Any CPU {61AB84FA-D4F6-4B78-8E82-6749A3EC9C1C}.Release|x86.Build.0 = Release|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Debug|x64.ActiveCfg = Debug|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Debug|x64.Build.0 = Debug|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Debug|x86.ActiveCfg = Debug|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Debug|x86.Build.0 = Debug|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Release|Any CPU.Build.0 = Release|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Release|x64.ActiveCfg = Release|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Release|x64.Build.0 = Release|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Release|x86.ActiveCfg = Release|Any CPU - {44DFE52E-543B-45A7-823D-F05DB3E1A3BA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {E891674B-721B-4F97-A1CB-2C76F4C542C6} = {0722D2A7-76C6-430F-A238-56685022F264} diff --git a/src/core/Wemogy.Infrastructure.Database.Core.UnitTests/Wemogy.Infrastructure.Database.Core.UnitTests.csproj b/src/core/Wemogy.Infrastructure.Database.Core.UnitTests/Wemogy.Infrastructure.Database.Core.UnitTests.csproj index c43fde0..3d2dfdb 100644 --- a/src/core/Wemogy.Infrastructure.Database.Core.UnitTests/Wemogy.Infrastructure.Database.Core.UnitTests.csproj +++ b/src/core/Wemogy.Infrastructure.Database.Core.UnitTests/Wemogy.Infrastructure.Database.Core.UnitTests.csproj @@ -7,6 +7,7 @@ + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -22,7 +23,6 @@ - \ No newline at end of file diff --git a/src/core/Wemogy.Infrastructure.Database.Core/Factories/DatabaseRepositoryFactoryFactory.ComposedPrimaryKey.cs b/src/core/Wemogy.Infrastructure.Database.Core/Factories/DatabaseRepositoryFactoryFactory.ComposedPrimaryKey.cs index e177ded..9ce1ebe 100644 --- a/src/core/Wemogy.Infrastructure.Database.Core/Factories/DatabaseRepositoryFactoryFactory.ComposedPrimaryKey.cs +++ b/src/core/Wemogy.Infrastructure.Database.Core/Factories/DatabaseRepositoryFactoryFactory.ComposedPrimaryKey.cs @@ -79,14 +79,15 @@ public ComposedPrimaryKeyDatabaseRepositoryFactoryDelegate TimeSpan.FromMilliseconds(100), 3)); + var databaseClientParameters = new[] + { + internalEntityType, + databaseRepositoryTypeMetadata.PartitionKeyType, + typeof(string) + }; var databaseClient = databaseClientFactory.InvokeGenericMethod( nameof(IDatabaseClientFactory.CreateClient), - new[] - { - internalEntityType, - databaseRepositoryTypeMetadata.PartitionKeyType, - typeof(string) - }, + databaseClientParameters, databaseRepositoryOptions); object databaseClientInstance = databaseClient; @@ -110,23 +111,24 @@ public ComposedPrimaryKeyDatabaseRepositoryFactoryDelegate new object[] { serviceProvider, repositoryReadFilterAttribute }); var internalReadFilters = getWrappedReadFiltersGenericMethod.Invoke( this, - new object[] { readFilters, composedPrimaryKeyBuilder.GetComposedPrimaryKeyPrefix() }); + new[] { readFilters, composedPrimaryKeyBuilder.GetComposedPrimaryKeyPrefix() }); var propertyFilters = getPropertyFiltersGenericMethod.Invoke( this, new object[] { serviceProvider, repositoryPropertyFilterAttribute }); var internalPropertyFilters = getWrappedPropertyFiltersGenericMethod.Invoke( this, - new object[] { propertyFilters }); + new[] { propertyFilters }); + object[] databaseRepositoryParameters = new[] + { + databaseClientInstance, + databaseRepositoryOptions, + internalReadFilters, + internalPropertyFilters, + composedPrimaryKeyBuilder + }; var databaseRepository = createComposedPrimaryKeyDatabaseRepositoryGenericMethod.Invoke( this, - new[] - { - databaseClientInstance, - databaseRepositoryOptions, - internalReadFilters, - internalPropertyFilters, - composedPrimaryKeyBuilder - }); + databaseRepositoryParameters); return retryProxy.Wrap(databaseRepository.ActLike()); }; } @@ -163,19 +165,23 @@ private List> GetWrappedReadFilte { var internalReadFilters = readFilters .Select( - x => new ComposedPrimaryKeyReadFilterWrapper(x, prefix) as IDatabaseRepositoryReadFilter) + x => new ComposedPrimaryKeyReadFilterWrapper( + x, + prefix) as IDatabaseRepositoryReadFilter) .ToList(); return internalReadFilters; } - private List> GetWrappedPropertyFilters( + private List> GetWrappedPropertyFilters( List> propertyFilters) where TEntity : class, IEntityBase where TId : IEquatable where TInternalEntity : IEntityBase { - var composedPrimaryKeyPropertyFilterWrapper = new ComposedPrimaryKeyPropertyFilterWrapper( - propertyFilters); + var composedPrimaryKeyPropertyFilterWrapper = + new ComposedPrimaryKeyPropertyFilterWrapper( + propertyFilters); if (composedPrimaryKeyPropertyFilterWrapper.IsEmpty) { diff --git a/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.Template.cs b/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.Template.cs index 6a6d6d4..893b7f9 100644 --- a/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.Template.cs +++ b/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.Template.cs @@ -1,21 +1,15 @@ using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading; -using System.Threading.Tasks; -using Mapster; using Wemogy.Infrastructure.Database.Core.Abstractions; using Wemogy.Infrastructure.Database.Core.Plugins.ComposedPrimaryKey.Abstractions; -using Wemogy.Infrastructure.Database.Core.ValueObjects; namespace Wemogy.Infrastructure.Database.Core.Plugins.ComposedPrimaryKey.Repositories; -public partial class ComposedPrimaryKeyDatabaseRepository +public partial class ComposedPrimaryKeyDatabaseRepository where TEntity : IEntityBase where TPartitionKey : IEquatable where TId : IEquatable where TInternalEntity : IEntityBase where TComposedPrimaryKeyBuilder : IComposedPrimaryKeyBuilder { - } diff --git a/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.cs b/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.cs index 6b7a668..063dc2e 100644 --- a/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.cs +++ b/src/core/Wemogy.Infrastructure.Database.Core/Plugins/ComposedPrimaryKey/Repositories/ComposedPrimaryKeyDatabaseRepository`5.cs @@ -85,7 +85,6 @@ private string BuildComposedPrimaryKey(TId id) return _composedPrimaryKeyBuilder.BuildComposedPrimaryKey(id); } - private QueryParameters AdaptToInternalEntityQueryParameters(QueryParameters queryParameters) { var idPropertyName = nameof(IEntityBase.Id).ToCamelCase(); diff --git a/src/core/Wemogy.Infrastructure.Database.Core/Wemogy.Infrastructure.Database.Core.csproj b/src/core/Wemogy.Infrastructure.Database.Core/Wemogy.Infrastructure.Database.Core.csproj index 90937d7..07a9acd 100644 --- a/src/core/Wemogy.Infrastructure.Database.Core/Wemogy.Infrastructure.Database.Core.csproj +++ b/src/core/Wemogy.Infrastructure.Database.Core/Wemogy.Infrastructure.Database.Core.csproj @@ -20,6 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + @@ -183,7 +184,4 @@ Compile - - - \ No newline at end of file diff --git a/src/switcher.json b/src/switcher.json index f2d44fa..3938969 100644 --- a/src/switcher.json +++ b/src/switcher.json @@ -3,25 +3,5 @@ "mappings": { "Wemogy.Core": "../../libs/helpers/src/Wemogy.Core/Wemogy.Core.csproj" }, - "restore": [ - { - "name": "Wemogy.Infrastructure.Database.Core", - "packages": [ - { - "packageName": "Wemogy.Core", - "version": "0.4.10" - } - ] - }, - { - "name": "Wemogy.Infrastructure.Database.Core.UnitTests", - "packages": [ - { - "packageName": "Wemogy.Core", - "version": "0.4.10" - } - ] - } - ], "removeProjects": true } \ No newline at end of file