Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMWebb committed Jul 27, 2024
1 parent 787a6cc commit b37e88f
Show file tree
Hide file tree
Showing 16 changed files with 194 additions and 23 deletions.
45 changes: 32 additions & 13 deletions Examples/Examples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validation", "Validation",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.Validation.FluentValidation", "Validation\Examples.Validation.FluentValidation\Examples.Validation.FluentValidation.csproj", "{256821F9-8160-4819-B0A1-B769C5BBBBB6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCommon.Persistence.Caching", "..\Src\RCommon.Persistence.Caching\RCommon.Persistence.Caching.csproj", "{B66429EB-4B5F-42F9-9CD7-7334190A14F4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RCommon.Persistence.Caching", "..\Src\RCommon.Persistence.Caching\RCommon.Persistence.Caching.csproj", "{B66429EB-4B5F-42F9-9CD7-7334190A14F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCommon.DistributedMemoryCache", "..\Src\RCommon.DistributedMemoryCache\RCommon.DistributedMemoryCache.csproj", "{DCF81616-F849-46BF-B7DE-1B30798418D0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCommon.JsonNet", "..\Src\RCommon.JsonNet\RCommon.JsonNet.csproj", "{6E3ED0D2-0619-4CB6-BAE2-10488DF061C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCommon.RedisCache", "RCommon.RedisCache\RCommon.RedisCache.csproj", "{6F9A2678-49D1-4626-B0AF-176B95AF3A72}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCommon.Json", "..\Src\RCommon.Json\RCommon.Json.csproj", "{36386A61-2408-44D7-8C4A-4748F79623FC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCommon.Caching", "..\Src\RCommon.Caching\RCommon.Caching.csproj", "{6C91AB35-2238-4EF5-82BF-81B3C3EF7061}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RCommon.RedisCache", "..\Src\RCommon.RedisCache\RCommon.RedisCache.csproj", "{10B9612F-DE04-4007-BDDE-B3DEBCEE59EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RCommon.MemoryCache", "RCommon.MemoryCache\RCommon.MemoryCache.csproj", "{69FF5D3E-CB99-41BE-8DE4-82E9C69C71EF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -309,14 +315,26 @@ Global
{B66429EB-4B5F-42F9-9CD7-7334190A14F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B66429EB-4B5F-42F9-9CD7-7334190A14F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B66429EB-4B5F-42F9-9CD7-7334190A14F4}.Release|Any CPU.Build.0 = Release|Any CPU
{DCF81616-F849-46BF-B7DE-1B30798418D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DCF81616-F849-46BF-B7DE-1B30798418D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCF81616-F849-46BF-B7DE-1B30798418D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCF81616-F849-46BF-B7DE-1B30798418D0}.Release|Any CPU.Build.0 = Release|Any CPU
{6F9A2678-49D1-4626-B0AF-176B95AF3A72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F9A2678-49D1-4626-B0AF-176B95AF3A72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F9A2678-49D1-4626-B0AF-176B95AF3A72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F9A2678-49D1-4626-B0AF-176B95AF3A72}.Release|Any CPU.Build.0 = Release|Any CPU
{6E3ED0D2-0619-4CB6-BAE2-10488DF061C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E3ED0D2-0619-4CB6-BAE2-10488DF061C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E3ED0D2-0619-4CB6-BAE2-10488DF061C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E3ED0D2-0619-4CB6-BAE2-10488DF061C6}.Release|Any CPU.Build.0 = Release|Any CPU
{36386A61-2408-44D7-8C4A-4748F79623FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36386A61-2408-44D7-8C4A-4748F79623FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36386A61-2408-44D7-8C4A-4748F79623FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36386A61-2408-44D7-8C4A-4748F79623FC}.Release|Any CPU.Build.0 = Release|Any CPU
{6C91AB35-2238-4EF5-82BF-81B3C3EF7061}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C91AB35-2238-4EF5-82BF-81B3C3EF7061}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C91AB35-2238-4EF5-82BF-81B3C3EF7061}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C91AB35-2238-4EF5-82BF-81B3C3EF7061}.Release|Any CPU.Build.0 = Release|Any CPU
{10B9612F-DE04-4007-BDDE-B3DEBCEE59EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10B9612F-DE04-4007-BDDE-B3DEBCEE59EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10B9612F-DE04-4007-BDDE-B3DEBCEE59EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10B9612F-DE04-4007-BDDE-B3DEBCEE59EB}.Release|Any CPU.Build.0 = Release|Any CPU
{69FF5D3E-CB99-41BE-8DE4-82E9C69C71EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69FF5D3E-CB99-41BE-8DE4-82E9C69C71EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69FF5D3E-CB99-41BE-8DE4-82E9C69C71EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69FF5D3E-CB99-41BE-8DE4-82E9C69C71EF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -366,8 +384,9 @@ Global
{BBBCCC2B-2218-4C32-96EE-C2153A23F643} = {3199F749-0082-41D0-91D3-ECED117F8B08}
{0F54DCE2-27A5-4D07-B542-6D2A7B50D0EC} = {3234C3BB-1632-4684-838E-9D6D382D4D4D}
{256821F9-8160-4819-B0A1-B769C5BBBBB6} = {0F54DCE2-27A5-4D07-B542-6D2A7B50D0EC}
{DCF81616-F849-46BF-B7DE-1B30798418D0} = {3199F749-0082-41D0-91D3-ECED117F8B08}
{6F9A2678-49D1-4626-B0AF-176B95AF3A72} = {3199F749-0082-41D0-91D3-ECED117F8B08}
{6E3ED0D2-0619-4CB6-BAE2-10488DF061C6} = {3199F749-0082-41D0-91D3-ECED117F8B08}
{10B9612F-DE04-4007-BDDE-B3DEBCEE59EB} = {3199F749-0082-41D0-91D3-ECED117F8B08}
{69FF5D3E-CB99-41BE-8DE4-82E9C69C71EF} = {3199F749-0082-41D0-91D3-ECED117F8B08}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B0CD26D-8067-4667-863E-6B0EE7EDAA42}
Expand Down
20 changes: 20 additions & 0 deletions Examples/RCommon.MemoryCache/MemoryCacheService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RCommon.MemoryCache
{
public class MemoryCacheService
{
private readonly IMemoryCache _memoryCache;

public MemoryCacheService(IMemoryCache memoryCache)
{
_memoryCache = memoryCache;

}
}
}
17 changes: 17 additions & 0 deletions Examples/RCommon.MemoryCache/RCommon.MemoryCache.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Src\RCommon.Caching\RCommon.Caching.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Text;
using System.Threading.Tasks;

namespace RCommon.Persistence.Caching
namespace RCommon.Caching
{
public class PersistenceCachingOptions
public class CachingOptions
{
}
}
12 changes: 12 additions & 0 deletions Src/RCommon.Caching/ICachingService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RCommon.Caching
{
public interface ICachingService
{
}
}
13 changes: 13 additions & 0 deletions Src/RCommon.Caching/RCommon.Caching.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
</ItemGroup>

</Project>
17 changes: 17 additions & 0 deletions Src/RCommon.Json/IJsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RCommon.Json
{
public interface IJsonSerializer
{
public string Serialize(object obj, JsonSerializeOptions options);

public T Deserialize<T>(string json, JsonDeserializeOptions options);

public object Deserialize(Type type, string json, JsonDeserializeOptions options);
}
}
12 changes: 12 additions & 0 deletions Src/RCommon.Json/JsonDeserializeOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RCommon.Json
{
public class JsonDeserializeOptions
{
}
}
12 changes: 12 additions & 0 deletions Src/RCommon.Json/JsonSerializeOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RCommon.Json
{
public class JsonSerializeOptions
{
}
}
File renamed without changes.
16 changes: 16 additions & 0 deletions Src/RCommon.JsonNet/JsonNetSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RCommon.JsonNet
{
public class JsonNetSerializer
{
public JsonNetSerializer()
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

</Project>
10 changes: 2 additions & 8 deletions Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
using RCommon.Caching;
using RCommon.Collections;
using RCommon.Entities;
using RCommon.Persistence.Crud;
Expand All @@ -17,15 +16,10 @@ public class CachingGraphRepository<TEntity> : IGraphRepository<TEntity>
where TEntity : class, IBusinessEntity
{
private readonly IGraphRepository<TEntity> _graphRepository;
private readonly IOptions<PersistenceCachingOptions> _cachingConfiguration;
private readonly IDistributedCache _distributedCache;

public CachingGraphRepository(IGraphRepository<TEntity> graphRepository, IOptions<PersistenceCachingOptions> cachingConfiguration,
IDistributedCache distributedCache)
public CachingGraphRepository(IGraphRepository<TEntity> graphRepository)
{
_graphRepository = graphRepository;
_cachingConfiguration = cachingConfiguration;
_distributedCache = distributedCache;
}

public bool Tracking { get => _graphRepository.Tracking; set => _graphRepository.Tracking = value; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\RCommon.Caching\RCommon.Caching.csproj" />
<ProjectReference Include="..\RCommon.Persistence\RCommon.Persistence.csproj" />
</ItemGroup>

Expand Down
17 changes: 17 additions & 0 deletions Src/RCommon.RedisCache/RCommon.RedisCache.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RCommon.Caching\RCommon.Caching.csproj" />
</ItemGroup>

</Project>
17 changes: 17 additions & 0 deletions Src/RCommon.RedisCache/RedisCacheService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.Extensions.Caching.Distributed;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RCommon.RedisCache
{
public class RedisCacheService
{
public RedisCacheService(IDistributedCache cache)
{
cache.
}
}
}

0 comments on commit b37e88f

Please sign in to comment.