Created
September 10, 2012 19:50
-
-
Save davybrion/3693394 to your computer and use it in GitHub Desktop.
code snippets for "Using Agatha’s Client-Side Caching" post
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
[EnableServiceResponseCaching(Minutes = 5)] | |
[EnableClientResponseCaching(Seconds = 30)] | |
public class ReverseStringRequest : Request | |
{ | |
public string StringToReverse { get; set; } | |
public bool Equals(ReverseStringRequest other) | |
{ | |
if (ReferenceEquals(null, other)) return false; | |
if (ReferenceEquals(this, other)) return true; | |
return Equals(other.StringToReverse, StringToReverse); | |
} | |
public override bool Equals(object obj) | |
{ | |
if (ReferenceEquals(null, obj)) return false; | |
if (ReferenceEquals(this, obj)) return true; | |
if (obj.GetType() != typeof(ReverseStringRequest)) return false; | |
return Equals((ReverseStringRequest)obj); | |
} | |
public override int GetHashCode() | |
{ | |
return (StringToReverse != null ? StringToReverse.GetHashCode() : 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment