Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianKuesters committed Sep 22, 2022
1 parent 0f89be9 commit f97fc68
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 67 deletions.
14 changes: 0 additions & 14 deletions src/Wemogy.Infrastructure.Database.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Wemogy.Core" Version="0.4.12" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -22,7 +23,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../../../libs/helpers/src/Wemogy.Core/Wemogy.Core.csproj" />
<ProjectReference Include="../Wemogy.Infrastructure.Database.Core/Wemogy.Infrastructure.Database.Core.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ public ComposedPrimaryKeyDatabaseRepositoryFactoryDelegate<TDatabaseRepository>
TimeSpan.FromMilliseconds(100),
3));

var databaseClientParameters = new[]
{
internalEntityType,
databaseRepositoryTypeMetadata.PartitionKeyType,
typeof(string)
};
var databaseClient = databaseClientFactory.InvokeGenericMethod<IDatabaseClient>(
nameof(IDatabaseClientFactory.CreateClient),
new[]
{
internalEntityType,
databaseRepositoryTypeMetadata.PartitionKeyType,
typeof(string)
},
databaseClientParameters,
databaseRepositoryOptions);

object databaseClientInstance = databaseClient;
Expand All @@ -110,23 +111,24 @@ public ComposedPrimaryKeyDatabaseRepositoryFactoryDelegate<TDatabaseRepository>
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<TDatabaseRepository>(databaseRepository.ActLike<TDatabaseRepository>());
};
}
Expand Down Expand Up @@ -163,19 +165,23 @@ private List<IDatabaseRepositoryReadFilter<TInternalEntity>> GetWrappedReadFilte
{
var internalReadFilters = readFilters
.Select(
x => new ComposedPrimaryKeyReadFilterWrapper<TInternalEntity, TEntity>(x, prefix) as IDatabaseRepositoryReadFilter<TInternalEntity>)
x => new ComposedPrimaryKeyReadFilterWrapper<TInternalEntity, TEntity>(
x,
prefix) as IDatabaseRepositoryReadFilter<TInternalEntity>)
.ToList();
return internalReadFilters;
}

private List<IDatabaseRepositoryPropertyFilter<TInternalEntity>> GetWrappedPropertyFilters<TInternalEntity, TEntity, TId>(
private List<IDatabaseRepositoryPropertyFilter<TInternalEntity>> GetWrappedPropertyFilters<TInternalEntity, TEntity,
TId>(
List<IDatabaseRepositoryPropertyFilter<TEntity>> propertyFilters)
where TEntity : class, IEntityBase<TId>
where TId : IEquatable<TId>
where TInternalEntity : IEntityBase<string>
{
var composedPrimaryKeyPropertyFilterWrapper = new ComposedPrimaryKeyPropertyFilterWrapper<TInternalEntity, TEntity, TId>(
propertyFilters);
var composedPrimaryKeyPropertyFilterWrapper =
new ComposedPrimaryKeyPropertyFilterWrapper<TInternalEntity, TEntity, TId>(
propertyFilters);

if (composedPrimaryKeyPropertyFilterWrapper.IsEmpty)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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<TEntity, TPartitionKey, TId, TInternalEntity, TComposedPrimaryKeyBuilder>
public partial class ComposedPrimaryKeyDatabaseRepository<TEntity, TPartitionKey, TId, TInternalEntity,
TComposedPrimaryKeyBuilder>
where TEntity : IEntityBase<TId>
where TPartitionKey : IEquatable<TPartitionKey>
where TId : IEquatable<TId>
where TInternalEntity : IEntityBase<string>
where TComposedPrimaryKeyBuilder : IComposedPrimaryKeyBuilder<TId>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ private string BuildComposedPrimaryKey(TId id)
return _composedPrimaryKeyBuilder.BuildComposedPrimaryKey(id);
}


private QueryParameters AdaptToInternalEntityQueryParameters(QueryParameters queryParameters)
{
var idPropertyName = nameof(IEntityBase<TId>.Id).ToCamelCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Wemogy.Core" Version="0.4.12" />
</ItemGroup>
<ItemGroup>
<Compile Update="Repositories\DatabaseRepository`3.Exists.cs">
Expand Down Expand Up @@ -183,7 +184,4 @@
<BuildAction>Compile</BuildAction>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../../../libs/helpers/src/Wemogy.Core/Wemogy.Core.csproj" />
</ItemGroup>
</Project>
20 changes: 0 additions & 20 deletions src/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit f97fc68

Please sign in to comment.