Created
January 7, 2018 00:03
-
-
Save aramkoukia/6f818724fb1f1cef729d432044a1449a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| using System; | |
| using Unity; | |
| using Unity.Interception.PolicyInjection.Pipeline; | |
| using Unity.Interception.PolicyInjection.Policies; | |
| namespace CachingAspectOrientedImplemetation | |
| { | |
| [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)] | |
| public class InvalidateCacheAttribute : HandlerAttribute | |
| { | |
| public InvalidateCacheAttribute(string keyPrefix) | |
| { | |
| this.KeyPrefix = KeyPrefix; | |
| } | |
| public string KeyPrefix { get; set; } | |
| public override ICallHandler CreateHandler(IUnityContainer container) | |
| { | |
| return new InvalidateCacheAttributeHandler(this.KeyPrefix); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment