diff --git a/Examples/Examples.sln b/Examples/Examples.sln index bcb92c8a..85a846b8 100644 --- a/Examples/Examples.sln +++ b/Examples/Examples.sln @@ -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 @@ -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 @@ -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} diff --git a/Examples/RCommon.MemoryCache/MemoryCacheService.cs b/Examples/RCommon.MemoryCache/MemoryCacheService.cs new file mode 100644 index 00000000..67a6a786 --- /dev/null +++ b/Examples/RCommon.MemoryCache/MemoryCacheService.cs @@ -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; + + } + } +} diff --git a/Examples/RCommon.MemoryCache/RCommon.MemoryCache.csproj b/Examples/RCommon.MemoryCache/RCommon.MemoryCache.csproj new file mode 100644 index 00000000..3b6a5faa --- /dev/null +++ b/Examples/RCommon.MemoryCache/RCommon.MemoryCache.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + diff --git a/Src/RCommon.Persistence.Caching/PersistenceCachingOptions.cs b/Src/RCommon.Caching/CachingOptions.cs similarity index 62% rename from Src/RCommon.Persistence.Caching/PersistenceCachingOptions.cs rename to Src/RCommon.Caching/CachingOptions.cs index 15c51501..aa4677f1 100644 --- a/Src/RCommon.Persistence.Caching/PersistenceCachingOptions.cs +++ b/Src/RCommon.Caching/CachingOptions.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace RCommon.Persistence.Caching +namespace RCommon.Caching { - public class PersistenceCachingOptions + public class CachingOptions { } } diff --git a/Src/RCommon.Caching/ICachingService.cs b/Src/RCommon.Caching/ICachingService.cs new file mode 100644 index 00000000..6f7ee968 --- /dev/null +++ b/Src/RCommon.Caching/ICachingService.cs @@ -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 + { + } +} diff --git a/Src/RCommon.Caching/RCommon.Caching.csproj b/Src/RCommon.Caching/RCommon.Caching.csproj new file mode 100644 index 00000000..cc6a561b --- /dev/null +++ b/Src/RCommon.Caching/RCommon.Caching.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/Src/RCommon.Json/IJsonSerializer.cs b/Src/RCommon.Json/IJsonSerializer.cs new file mode 100644 index 00000000..86449aa9 --- /dev/null +++ b/Src/RCommon.Json/IJsonSerializer.cs @@ -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(string json, JsonDeserializeOptions options); + + public object Deserialize(Type type, string json, JsonDeserializeOptions options); + } +} diff --git a/Src/RCommon.Json/JsonDeserializeOptions.cs b/Src/RCommon.Json/JsonDeserializeOptions.cs new file mode 100644 index 00000000..6ed1ff42 --- /dev/null +++ b/Src/RCommon.Json/JsonDeserializeOptions.cs @@ -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 + { + } +} diff --git a/Src/RCommon.Json/JsonSerializeOptions.cs b/Src/RCommon.Json/JsonSerializeOptions.cs new file mode 100644 index 00000000..dcc3e431 --- /dev/null +++ b/Src/RCommon.Json/JsonSerializeOptions.cs @@ -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 + { + } +} diff --git a/Examples/RCommon.RedisCache/RCommon.RedisCache.csproj b/Src/RCommon.Json/RCommon.Json.csproj similarity index 100% rename from Examples/RCommon.RedisCache/RCommon.RedisCache.csproj rename to Src/RCommon.Json/RCommon.Json.csproj diff --git a/Src/RCommon.JsonNet/JsonNetSerializer.cs b/Src/RCommon.JsonNet/JsonNetSerializer.cs new file mode 100644 index 00000000..d194ee9a --- /dev/null +++ b/Src/RCommon.JsonNet/JsonNetSerializer.cs @@ -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() + { + + } + } +} diff --git a/Src/RCommon.DistributedMemoryCache/RCommon.DistributedMemoryCache.csproj b/Src/RCommon.JsonNet/RCommon.JsonNet.csproj similarity index 68% rename from Src/RCommon.DistributedMemoryCache/RCommon.DistributedMemoryCache.csproj rename to Src/RCommon.JsonNet/RCommon.JsonNet.csproj index fa71b7ae..3b5b1707 100644 --- a/Src/RCommon.DistributedMemoryCache/RCommon.DistributedMemoryCache.csproj +++ b/Src/RCommon.JsonNet/RCommon.JsonNet.csproj @@ -6,4 +6,8 @@ enable + + + + diff --git a/Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs b/Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs index 5023a0f8..fc10bee6 100644 --- a/Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs +++ b/Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs @@ -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; @@ -17,15 +16,10 @@ public class CachingGraphRepository : IGraphRepository where TEntity : class, IBusinessEntity { private readonly IGraphRepository _graphRepository; - private readonly IOptions _cachingConfiguration; - private readonly IDistributedCache _distributedCache; - public CachingGraphRepository(IGraphRepository graphRepository, IOptions cachingConfiguration, - IDistributedCache distributedCache) + public CachingGraphRepository(IGraphRepository graphRepository) { _graphRepository = graphRepository; - _cachingConfiguration = cachingConfiguration; - _distributedCache = distributedCache; } public bool Tracking { get => _graphRepository.Tracking; set => _graphRepository.Tracking = value; } diff --git a/Src/RCommon.Persistence.Caching/RCommon.Persistence.Caching.csproj b/Src/RCommon.Persistence.Caching/RCommon.Persistence.Caching.csproj index 8c7b2f91..3e593c66 100644 --- a/Src/RCommon.Persistence.Caching/RCommon.Persistence.Caching.csproj +++ b/Src/RCommon.Persistence.Caching/RCommon.Persistence.Caching.csproj @@ -7,6 +7,7 @@ + diff --git a/Src/RCommon.RedisCache/RCommon.RedisCache.csproj b/Src/RCommon.RedisCache/RCommon.RedisCache.csproj new file mode 100644 index 00000000..e8f1ca25 --- /dev/null +++ b/Src/RCommon.RedisCache/RCommon.RedisCache.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + diff --git a/Src/RCommon.RedisCache/RedisCacheService.cs b/Src/RCommon.RedisCache/RedisCacheService.cs new file mode 100644 index 00000000..ab2078d0 --- /dev/null +++ b/Src/RCommon.RedisCache/RedisCacheService.cs @@ -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. + } + } +}