-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update method visibility, add support for custom function keys, updat…
…e example project
- Loading branch information
1 parent
8b73566
commit 96bb48e
Showing
7 changed files
with
47 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
using gj.autofac.caching.redis; | ||
|
||
namespace RedisCacheTester; | ||
|
||
using System.Threading.Tasks; | ||
namespace gj.autofac.caching.redis.tester; | ||
|
||
public interface IExampleService | ||
{ | ||
[RedisCache(60)] | ||
[RedisCache(120)] | ||
Task<int[]> AsyncFunctionTest(int id); | ||
|
||
[RedisCache(60)] | ||
[RedisCache(120)] | ||
Task AsyncActionTest(int id); | ||
[RedisCache(60)] | ||
[RedisCache(120)] | ||
int SynchronousTaskTest(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace gj.autofac.caching.redis; | ||
|
||
internal enum MethodType | ||
{ | ||
Synchronous, | ||
AsyncAction, | ||
AsyncFunction | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
namespace gj.autofac.caching.redis; | ||
|
||
[AttributeUsage(AttributeTargets.Method)] | ||
public class RedisCacheAttribute(int durationSeconds = 60) : Attribute | ||
public class RedisCacheAttribute(int durationSeconds = 60, string key = "") : Attribute | ||
{ | ||
public int DurationSeconds { get; } = durationSeconds; | ||
public string Key { get; set; } = key; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters