Permalink
Browse files

caching.redis caching couchbase done (net45 only)

  • Loading branch information...
1 parent 780dd7f commit 957b70b6c8ae3c13c69e896801dc74166882ac90 @volkanceylan committed Jan 5, 2017
View
@@ -132,6 +132,8 @@ Task("Build")
var dotnetProjects = new string[] {
"Serenity.Core",
+ "Serenity.Caching.Couchbase",
+ "Serenity.Caching.Redis",
"Serenity.Data",
"Serenity.Data.Entity",
"Serenity.Services",
@@ -300,8 +302,8 @@ Task("NuGet")
.Does(() =>
{
myPack("Serenity.Core", null);
- //myPack("Serenity.Caching.Couchbase", null);
- //myPack("Serenity.Caching.Redis", null);
+ myPack("Serenity.Caching.Couchbase", null);
+ myPack("Serenity.Caching.Redis", null);
myPack("Serenity.Data", null);
myPack("Serenity.Data.Entity", null);
myPack("Serenity.Services", null);
@@ -57,8 +57,12 @@
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
- <Compile Include="CouchbaseDistributedCache.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="..\Serenity.Caching.Couchbase\CouchbaseDistributedCache.cs">
+ <Link>CouchbaseDistributedCache.cs</Link>
+ </Compile>
+ <Compile Include="..\Serenity.Caching.Couchbase\Properties\AssemblyInfo.cs">
+ <Link>Properties\AssemblyInfo.cs</Link>
+ </Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Serenity.Core.Net45\Serenity.Core.csproj">
@@ -67,7 +71,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -1,13 +1,12 @@
namespace Serenity
{
+ using ComponentModel;
using Couchbase;
using Couchbase.Configuration.Client;
using Couchbase.Core;
- using Newtonsoft.Json;
using Serenity.Abstractions;
using System;
- using System.Configuration;
public class CouchbaseDistributedCache : IDistributedCache, IDisposable
{
@@ -18,11 +17,7 @@ public class CouchbaseDistributedCache : IDistributedCache, IDisposable
public CouchbaseDistributedCache()
{
- var setting = (ConfigurationManager.AppSettings["DistributedCache"] ?? "").Trim();
- if (setting.Length == 0)
- setting = "{}";
-
- this.configuration = JsonConvert.DeserializeObject<Configuration>(setting, JsonSettings.Tolerant);
+ this.configuration = Config.Get<Configuration>();
if (String.IsNullOrWhiteSpace(this.configuration.ServerAddress))
throw new InvalidOperationException(
@@ -86,6 +81,7 @@ public void Set<TValue>(string key, TValue value, TimeSpan expiration)
cacheClient.Upsert(key, value, expiration);
}
+ [SettingKey("DistributedCache"), SettingScope("Application")]
private class Configuration
{
public string ServerAddress { get; set; }
@@ -14,13 +14,24 @@
<copyright>${copyright}</copyright>
<tags>${tags}</tags>
<dependencies>
- <dependency id="Newtonsoft.Json" version="${jsonNetVersion}" />
- <dependency id="Serenity.Core" version="${version}" />
- <dependency id="CouchbaseNetClient" version="${couchbaseNetClientVersion}" />
+ <group targetFramework=".NETFramework4.5">
+ <dependency id="CouchbaseNetClient" version="${net45:CouchbaseNetClient}" />
+ <dependency id="Newtonsoft.Json" version="${*:Newtonsoft.Json}" />
+ <dependency id="Serenity.Core" version="${version}" />
+ </group>
+<!-- CouchbaseNetClient is prerelease
+ <group targetFramework=".NETStandard1.6">
+ <dependency id="CouchbaseNetClient" version="${netstandard1.6:CouchbaseNetClient}" />
+ <dependency id="Newtonsoft.Json" version="${*:Newtonsoft.Json}" />
+ <dependency id="Serenity.Core" version="${version}" />
+ </group>
+-->
+
</dependencies>
</metadata>
<files>
- <file src="${id}.dll" target="lib/${framework}" />
- <file src="${id}.pdb" target="lib/${framework}" />
+ <file src="../Serenity.Caching.Couchbase.Net45/bin/${configuration}/Serenity.Caching.Couchbase.dll" target="lib/net45" />
+ <file src="../Serenity.Caching.Couchbase.Net45/bin/${configuration}/Serenity.Caching.Couchbase.pdb" target="lib/net45" />
+<!-- <file src="bin/${configuration}/netstandard1.6/Serenity.Caching.Couchbase.dll" target="lib/netstandard1.6" />-->
</files>
</package>
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>72e76440-83af-4e4c-a212-7e72ba6c15d5</ProjectGuid>
+ <RootNamespace>Serenity.Caching.Couchbase</RootNamespace>
+ <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
+ <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
+ <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
@@ -0,0 +1,30 @@
+{
+ "version": "2.8.0-*",
+ "dependencies": {
+ "Newtonsoft.Json": "9.0.1",
+ "Serenity.Core": "2.8.0-*"
+ },
+ "frameworks": {
+ "netstandard1.6": {
+ "buildOptions": {
+ "define": [
+ "COREFX",
+ "NETSTANDARD1_6"
+ ]
+ },
+ "dependencies": {
+ "CouchbaseNetClient": "2.4.0-dp3"
+ }
+ },
+ "net45": {
+ "dependencies": {
+ "CouchbaseNetClient": "2.3.11"
+ }
+ }
+ },
+ "buildOptions": {
+ "compile": {
+ "excludeFiles": []
+ }
+ }
+}
@@ -46,8 +46,12 @@
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="RedisDistributedCache.cs" />
+ <Compile Include="..\Serenity.Caching.Redis\Properties\AssemblyInfo.cs">
+ <Link>Properties\AssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="..\Serenity.Caching.Redis\RedisDistributedCache.cs">
+ <Link>RedisDistributedCache.cs</Link>
+ </Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Serenity.Core.Net45\Serenity.Core.csproj">
@@ -14,12 +14,21 @@
<copyright>${copyright}</copyright>
<tags>${tags}</tags>
<dependencies>
- <dependency id="StackExchange.Redis" version="${stackExchangeRedisVersion}" />
- <dependency id="Serenity.Core" version="${version}" />
+ <group targetFramework=".NETFramework4.5">
+ <dependency id="StackExchange.Redis" version="${*:StackExchange.Redis}" />
+ <dependency id="Newtonsoft.Json" version="${*:Newtonsoft.Json}" />
+ <dependency id="Serenity.Core" version="${version}" />
+ </group>
+ <group targetFramework=".NETStandard1.6">
+ <dependency id="StackExchange.Redis" version="${*:StackExchange.Redis}" />
+ <dependency id="Newtonsoft.Json" version="${*:Newtonsoft.Json}" />
+ <dependency id="Serenity.Core" version="${version}" />
+ </group>
</dependencies>
</metadata>
<files>
- <file src="${id}.dll" target="lib/${framework}" />
- <file src="${id}.pdb" target="lib/${framework}" />
+ <file src="../Serenity.Caching.Redis.Net45/bin/${configuration}/Serenity.Caching.Redis.dll" target="lib/net45" />
+ <file src="../Serenity.Caching.Redis.Net45/bin/${configuration}/Serenity.Caching.Redis.pdb" target="lib/net45" />
+ <file src="bin/${configuration}/netstandard1.6/Serenity.Caching.Redis.dll" target="lib/netstandard1.6" />
</files>
</package>
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>e97e4a31-3c67-4238-84a0-04fa3d59fd2f</ProjectGuid>
+ <RootNamespace>Serenity.Caching.Redis</RootNamespace>
+ <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
+ <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
+ <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
@@ -0,0 +1,27 @@
+{
+ "version": "2.8.0-*",
+ "dependencies": {
+ "Newtonsoft.Json": "9.0.1",
+ "Serenity.Core": "2.8.0-*",
+ "StackExchange.Redis": "1.1.608"
+ },
+ "frameworks": {
+ "netstandard1.6": {
+ "buildOptions": {
+ "define": [
+ "COREFX",
+ "NETSTANDARD1_6"
+ ]
+ },
+ "dependencies": {}
+ },
+ "net45": {
+ "dependencies": {}
+ }
+ },
+ "buildOptions": {
+ "compile": {
+ "excludeFiles": []
+ }
+ }
+}
View
@@ -5,7 +5,7 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.Core", "Serenity.Core.Net45\Serenity.Core.csproj", "{F76A7628-D2E9-43CC-A3F4-98F76C33DCDB}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.Caching.Couchbase", "Serenity.Caching.Couchbase\Serenity.Caching.Couchbase.csproj", "{12C5F0EF-FFAD-4820-A078-8F78A5372657}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.Caching.Couchbase", "Serenity.Caching.Couchbase.Net45\Serenity.Caching.Couchbase.csproj", "{12C5F0EF-FFAD-4820-A078-8F78A5372657}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.Data", "Serenity.Data.Net45\Serenity.Data.csproj", "{BF7AC82B-3476-4235-8CC2-58BBA1C4804B}"
EndProject
@@ -35,7 +35,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.Web", "Serenity.We
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.CodeGenerator", "Serenity.CodeGenerator\Serenity.CodeGenerator.csproj", "{49704C9A-30A2-43DE-AE3D-D13073BA50A4}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.Caching.Redis", "Serenity.Caching.Redis\Serenity.Caching.Redis.csproj", "{CEBB3CF6-8EED-4F6D-B29B-0EA5FF06FAF4}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serenity.Caching.Redis", "Serenity.Caching.Redis.Net45\Serenity.Caching.Redis.csproj", "{CEBB3CF6-8EED-4F6D-B29B-0EA5FF06FAF4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
View
@@ -13,6 +13,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serenity.Services", "Sereni
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serenity.Web", "Serenity.Web\Serenity.Web.xproj", "{2DB8084A-1CF1-490F-AE59-7DB6AFC29FCA}"
EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serenity.Caching.Couchbase", "Serenity.Caching.Couchbase\Serenity.Caching.Couchbase.xproj", "{72E76440-83AF-4E4C-A212-7E72BA6C15D5}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serenity.Caching.Redis", "Serenity.Caching.Redis\Serenity.Caching.Redis.xproj", "{E97E4A31-3C67-4238-84A0-04FA3D59FD2F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -39,6 +43,14 @@ Global
{2DB8084A-1CF1-490F-AE59-7DB6AFC29FCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DB8084A-1CF1-490F-AE59-7DB6AFC29FCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DB8084A-1CF1-490F-AE59-7DB6AFC29FCA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {72E76440-83AF-4E4C-A212-7E72BA6C15D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {72E76440-83AF-4E4C-A212-7E72BA6C15D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {72E76440-83AF-4E4C-A212-7E72BA6C15D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {72E76440-83AF-4E4C-A212-7E72BA6C15D5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E97E4A31-3C67-4238-84A0-04FA3D59FD2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E97E4A31-3C67-4238-84A0-04FA3D59FD2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E97E4A31-3C67-4238-84A0-04FA3D59FD2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E97E4A31-3C67-4238-84A0-04FA3D59FD2F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

0 comments on commit 957b70b

Please sign in to comment.