├── redis-com-client
├── packages.config
├── ICacheManager.cs
├── CacheFactory.cs
├── Properties
│ └── AssemblyInfo.cs
├── MyTable.cs
├── redis-com-client.csproj
└── CacheManager.cs
├── README.md
├── redis-com-client-test
├── Properties
│ └── AssemblyInfo.cs
├── redis-com-client-test.csproj
└── BasicTest.cs
├── redis-com-client.sln
├── .gitattributes
└── .gitignore
/redis-com-client/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/redis-com-client/ICacheManager.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | namespace redis_com_client
4 | {
5 | [ComVisible(true)]
6 | [Guid("c8109c73-2528-4e90-a999-81abd1fc7a70")]
7 | [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
8 | public interface ICacheManager
9 | {
10 | void Add(string key, object value);
11 | object Get(string key);
12 | void RemoveAll();
13 | object this[string key] { get; set; }
14 | void Init(string cacheId);
15 | void Remove(string key);
16 | bool Exists(string key);
17 | void SetExpiration(string key, int milliseconds);
18 | }
19 | }
--------------------------------------------------------------------------------
/redis-com-client/CacheFactory.cs:
--------------------------------------------------------------------------------
1 | using StackExchange.Redis;
2 |
3 | namespace redis_com_client
4 | {
5 | public class CacheFactory
6 | {
7 | private static ConnectionMultiplexer _redisClientsManager;
8 |
9 |
10 | private CacheFactory()
11 | {
12 |
13 | }
14 |
15 | public static IDatabase GetInstance()
16 | {
17 | if (_redisClientsManager == null)
18 | _redisClientsManager = ConnectionMultiplexer.Connect("localhost");
19 |
20 | return _redisClientsManager.GetDatabase();
21 | }
22 |
23 | public static IServer GetServer()
24 | {
25 | if (_redisClientsManager == null)
26 | _redisClientsManager = ConnectionMultiplexer.Connect("localhost");
27 |
28 | return _redisClientsManager.GetServer("localhost", 6379);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # redis-com-client
2 | Redis Client for COM+ | StackExchange.Redis Wrapper
3 |
4 | This was made to be used on Classic ASP (ASP 3.0).
5 |
6 | Line command to install the COM+:
7 |
8 | %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm redis-com-client.dll /tlb:redis-com-client.tlb /codebase
9 |
10 | On the ASP side you have not create the object. I initialized this in the global.asa using this:
11 | - < OBJECT RUNAT=Server SCOPE=Application ID=Cache PROGID=CacheManager>
12 |
13 | However, it also works if you want to create a scoped object:
14 | - Set Cache = Server.CreateObject("CacheManager")
15 |
16 |
17 | Later you can use these operations:
18 |
19 | - Initiliaze (this operation is required in order to share the same Redis instance with N sites)
20 | Cache.Init "prefix1"
21 |
22 | -**Add**
23 |
24 | Cache.Add "key1", "value"
25 |
26 | **or**
27 |
28 | Cache("key1") = "value"
29 |
30 | -**Add with expiration**
31 |
32 | Cache.SetExpiration "key1", "value", 1000 'ms
33 |
34 | -**Get**
35 |
36 | Cache.Get "key1"
37 |
38 | **or**
39 |
40 | Cache("key1")
41 |
42 | -**Remove**
43 |
44 | Cache.Remove "key1"
45 |
46 | -**Remove All**
47 |
48 | Cache.RemoveAll()
49 |
--------------------------------------------------------------------------------
/redis-com-client/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("redis-com-client")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("redis-com-client")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("6a8a31f6-4309-453d-84cf-202ea5eb7c75")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/redis-com-client-test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("redis-com-client-test")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("redis-com-client-test")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("9d586484-2934-467d-83f3-5686e7474ac6")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/redis-com-client.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "redis-com-client", "redis-com-client\redis-com-client.csproj", "{6A8A31F6-4309-453D-84CF-202EA5EB7C75}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "redis-com-client-test", "redis-com-client-test\redis-com-client-test.csproj", "{9D586484-2934-467D-83F3-5686E7474AC6}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {6A8A31F6-4309-453D-84CF-202EA5EB7C75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {6A8A31F6-4309-453D-84CF-202EA5EB7C75}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {6A8A31F6-4309-453D-84CF-202EA5EB7C75}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {6A8A31F6-4309-453D-84CF-202EA5EB7C75}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {9D586484-2934-467D-83F3-5686E7474AC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {9D586484-2934-467D-83F3-5686E7474AC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {9D586484-2934-467D-83F3-5686E7474AC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {9D586484-2934-467D-83F3-5686E7474AC6}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/redis-com-client/MyTable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace redis_com_client
5 | {
6 | public class MyTable
7 | {
8 | public List> ArrayCollumns {get; set;} //This typo is to make it different
9 | public List