Created
January 6, 2018 23:57
-
-
Save aramkoukia/c9b895bdbb7162aba647a77cc0659d69 to your computer and use it in GitHub Desktop.
User Repository
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.Collections.Generic; | |
| namespace CachingAspectOrientedImplemetation | |
| { | |
| public class UserRepository : IUserRepository | |
| { | |
| [Cache("key")] | |
| public IEnumerable<string> GetUsers() | |
| { | |
| return new string[] { "User 1", "User 2" }; | |
| } | |
| public string GetUsers(string id) | |
| { | |
| return "User 1"; | |
| } | |
| [InvalidateCache("key")] | |
| public bool UpdateUser(string username) | |
| { | |
| return true; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment