Skip to content

Instantly share code, notes, and snippets.

@aramkoukia
Created January 6, 2018 23:57
Show Gist options
  • Select an option

  • Save aramkoukia/c9b895bdbb7162aba647a77cc0659d69 to your computer and use it in GitHub Desktop.

Select an option

Save aramkoukia/c9b895bdbb7162aba647a77cc0659d69 to your computer and use it in GitHub Desktop.
User Repository
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