Skip to content

Commit 0499d1d

Browse files
committed
Unified .NET 452 and .NET Standard repositories
1 parent f5af136 commit 0499d1d

44 files changed

Lines changed: 228 additions & 1815 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SharpRepository.EfCoreRepository/SharpRepository.EfCoreRepository.DotNetCore.csproj renamed to SharpRepository.EfCoreRepository/SharpRepository.EfCoreRepository.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.0" />
2525
</ItemGroup>
2626
<ItemGroup>
27-
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.DotNetCore.csproj" />
27+
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.csproj" />
2828
</ItemGroup>
2929
</Project>

SharpRepository.EfRepository/SharpRepository.EfRepository.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
</ProjectReference>
6767
</ItemGroup>
6868
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
69+
<ProjectExtensions>
70+
<VisualStudio>
71+
<UserProperties project_1json__JSONSchema="" />
72+
</VisualStudio>
73+
</ProjectExtensions>
6974
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
7075
Other similar extension points exist, see Microsoft.Common.targets.
7176
<Target Name="BeforeBuild">

SharpRepository.InMemoryRepository/SharpRepository.InMemoryRepository.DotNetCore.csproj

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 11 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,19 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{13AD3FCA-4C9D-4674-B786-F30843638D3B}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>SharpRepository.InMemoryRepository</RootNamespace>
1+
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
2+
<PropertyGroup Label="Configuration">
123
<AssemblyName>SharpRepository.InMemoryRepository</AssemblyName>
13-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<TargetFrameworkProfile />
16-
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
<Prefer32Bit>false</Prefer32Bit>
4+
<RootNamespace>SharpRepository.InMemoryRepository</RootNamespace>
265
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
<Prefer32Bit>false</Prefer32Bit>
6+
<PropertyGroup>
7+
<TargetFramework>netstandard1.6</TargetFramework>
358
</PropertyGroup>
369
<ItemGroup>
37-
<Reference Include="System" />
38-
<Reference Include="System.Configuration" />
39-
<Reference Include="System.Core" />
40-
</ItemGroup>
41-
<ItemGroup>
42-
<Compile Include="InMemoryCompoundKeyRepositoryBase.cs" />
43-
<Compile Include="IAmInInMemoryRepository.cs" />
44-
<Compile Include="InMemoryConfigRepositoryFactory.cs" />
45-
<Compile Include="InMemoryRepository.cs" />
46-
<Compile Include="InMemoryRepositoryBase.cs" />
47-
<Compile Include="InMemoryRepositoryConfiguration.cs" />
48-
<Compile Include="Properties\AssemblyInfo.cs" />
49-
</ItemGroup>
50-
<ItemGroup>
51-
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.csproj">
52-
<Project>{710DEE79-25CE-4F68-B8B1-D08A135AD154}</Project>
53-
<Name>SharpRepository.Repository</Name>
54-
</ProjectReference>
10+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.0" />
11+
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="1.1.0" />
12+
<PackageReference Include="System.Linq.Queryable" Version="4.3.0" />
13+
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
14+
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.0" />
5515
</ItemGroup>
5616
<ItemGroup>
57-
<None Include="project.json" />
58-
<None Include="_nuget\content\config.transform" />
59-
<None Include="_nuget\tools\Install.ps1" />
17+
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.csproj" />
6018
</ItemGroup>
61-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
62-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
63-
Other similar extension points exist, see Microsoft.Common.targets.
64-
<Target Name="BeforeBuild">
65-
</Target>
66-
<Target Name="AfterBuild">
67-
</Target>
68-
-->
6919
</Project>

SharpRepository.Ioc.StructureMap/SharpRepository.Ioc.StructureMap.DotNetCore.csproj

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 11 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,21 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{0B4BDC6D-6030-48FD-B22A-F9A9A7A00812}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>SharpRepository.Ioc.StructureMap</RootNamespace>
4+
<TargetFramework>netstandard1.6</TargetFramework>
115
<AssemblyName>SharpRepository.Ioc.StructureMap</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile />
15-
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
<Prefer32Bit>false</Prefer32Bit>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
33-
<Prefer32Bit>false</Prefer32Bit>
6+
<RootNamespace>SharpRepository.Ioc.StructureMap</RootNamespace>
347
</PropertyGroup>
8+
359
<ItemGroup>
36-
<Reference Include="System" />
37-
<Reference Include="System.Core" />
38-
</ItemGroup>
39-
<ItemGroup>
40-
<Compile Include="Factories\CompoundKey.cs" />
41-
<Compile Include="Factories\TripleKey.cs" />
42-
<Compile Include="Factories\DoubleKey.cs" />
43-
<Compile Include="Factories\SingleKey.cs" />
44-
<Compile Include="Factories\NoKey.cs" />
45-
<Compile Include="Properties\AssemblyInfo.cs" />
46-
<Compile Include="StructureMapExtensions.cs" />
47-
<Compile Include="StructureMapRepositoryDependencyResolver.cs" />
10+
<PackageReference Include="StructureMap" Version="4.5.0" />
4811
</ItemGroup>
12+
4913
<ItemGroup>
50-
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.csproj">
51-
<Project>{710dee79-25ce-4f68-b8b1-d08a135ad154}</Project>
52-
<Name>SharpRepository.Repository</Name>
53-
</ProjectReference>
14+
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.csproj" />
5415
</ItemGroup>
16+
5517
<ItemGroup>
56-
<None Include="project.json" />
18+
<Folder Include="Properties\" />
5719
</ItemGroup>
58-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
59-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
60-
Other similar extension points exist, see Microsoft.Common.targets.
61-
<Target Name="BeforeBuild">
62-
</Target>
63-
<Target Name="AfterBuild">
64-
</Target>
65-
-->
20+
6621
</Project>

SharpRepository.MongoDbRepository/SharpRepository.MongoDbRepository.DotNetCore.csproj

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 12 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,22 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{DC40FEBE-2E39-4CB8-AE11-DFE9F6865BD2}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>SharpRepository.MongoDbRepository</RootNamespace>
4+
<TargetFramework>netstandard1.6</TargetFramework>
125
<AssemblyName>SharpRepository.MongoDbRepository</AssemblyName>
13-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<TargetFrameworkProfile />
16-
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
<Prefer32Bit>false</Prefer32Bit>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
<Prefer32Bit>false</Prefer32Bit>
6+
<RootNamespace>SharpRepository.MongoDbRepository</RootNamespace>
357
</PropertyGroup>
8+
369
<ItemGroup>
37-
<Reference Include="System" />
38-
<Reference Include="System.Configuration" />
39-
<Reference Include="System.Core" />
40-
<Reference Include="System.Data" />
41-
</ItemGroup>
42-
<ItemGroup>
43-
<Compile Include="IAmInMongoDbRepository.cs" />
44-
<Compile Include="MongoDbConfigRepositoryFactory.cs" />
45-
<Compile Include="MongoDbRepositoryConfiguration.cs" />
46-
<Compile Include="MongoDbRepositoryManager.cs" />
47-
<Compile Include="Properties\AssemblyInfo.cs" />
48-
<Compile Include="MongoDbRepository.cs" />
49-
<Compile Include="MongoDbRepositoryBase.cs" />
10+
<Folder Include="Properties\" />
5011
</ItemGroup>
12+
5113
<ItemGroup>
52-
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.csproj">
53-
<Project>{710DEE79-25CE-4F68-B8B1-D08A135AD154}</Project>
54-
<Name>SharpRepository.Repository</Name>
55-
</ProjectReference>
14+
<PackageReference Include="MongoDB.Bson" Version="2.4.4" />
15+
<PackageReference Include="MongoDB.Driver" Version="2.4.4" />
5616
</ItemGroup>
17+
5718
<ItemGroup>
58-
<None Include="app.config" />
59-
<None Include="project.json" />
19+
<ProjectReference Include="..\SharpRepository.Repository\SharpRepository.Repository.csproj" />
6020
</ItemGroup>
61-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
62-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
63-
Other similar extension points exist, see Microsoft.Common.targets.
64-
<Target Name="BeforeBuild">
65-
</Target>
66-
<Target Name="AfterBuild">
67-
</Target>
68-
-->
21+
6922
</Project>

SharpRepository.Repository/Caching/Hash/LocalCollectionExpander.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ protected override Expression VisitMethodCall(MethodCallExpression node)
3030

3131
// for any local collection parameters in the method, make a
3232
// replacement argument which will print its elements
33-
#if NET451
34-
var replacements = (from x in map
35-
where x.Param != null && x.Param.IsGenericType
36-
let g = x.Param.GetGenericTypeDefinition()
37-
where g == typeof(IEnumerable<>) || g == typeof(List<>)
38-
where x.Arg.NodeType == ExpressionType.Constant
39-
let elementType = x.Param.GetGenericArguments().Single()
40-
let printer = MakePrinter((ConstantExpression)x.Arg, elementType)
41-
select new { x.Arg, Replacement = printer }).ToList();
42-
#elif NETSTANDARD1_6
4333
var replacements = (from x in map
4434
where x.Param != null && x.Param.GetType().GetTypeInfo().IsGenericType
4535
let g = x.Param.GetGenericTypeDefinition()
@@ -48,7 +38,6 @@ protected override Expression VisitMethodCall(MethodCallExpression node)
4838
let elementType = x.Param.GenericTypeArguments.Single()
4939
let printer = MakePrinter((ConstantExpression)x.Arg, elementType)
5040
select new { x.Arg, Replacement = printer }).ToList();
51-
#endif
5241

5342
if (replacements.Any())
5443
{

SharpRepository.Repository/Caching/StandardCachingStrategyBase.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ public bool TryPartitionValue(T entity, out TPartition value)
162162

163163
// use the partition name (which is a property) and reflection to get the value
164164
var type = typeof(T);
165-
#if NET451
166-
var propInfo = type.GetProperty(partitionName, typeof(TPartition));
167-
#elif NETSTANDARD1_6
168165
var propInfo = type.GetTypeInfo().DeclaredProperties.FirstOrDefault(p => p.Name == partitionName && p.PropertyType == typeof(TPartition));
169-
#endif
170166

171167
if (propInfo == null)
172168
return false;

0 commit comments

Comments
 (0)