Created
September 10, 2012 19:57
-
-
Save davybrion/3693436 to your computer and use it in GitHub Desktop.
code snippets for "Using Agatha’s Server-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 = 10, Region = "Issues")] | |
public class GetUnassignedIssuesForProjectRequest : Request | |
{ | |
public Guid ProjectId { get; set; } | |
} |
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 = 10, Region = "Issues")] | |
public class GetUnassignedIssuesForProjectRequest : Request | |
{ | |
public Guid ProjectId { get; set; } | |
public bool Equals(GetUnassignedIssuesForProjectRequest other) | |
{ | |
if (ReferenceEquals(null, other)) return false; | |
if (ReferenceEquals(this, other)) return true; | |
return other.ProjectId.Equals(ProjectId); | |
} | |
public override bool Equals(object obj) | |
{ | |
if (ReferenceEquals(null, obj)) return false; | |
if (ReferenceEquals(this, obj)) return true; | |
if (obj.GetType() != typeof(GetUnassignedIssuesForProjectRequest)) return false; | |
return Equals((GetUnassignedIssuesForProjectRequest)obj); | |
} | |
public override int GetHashCode() | |
{ | |
return ProjectId.GetHashCode(); | |
} | |
} |
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(Hours = 2, Region = "ReferenceData")] | |
public class GetAllCountriesRequest : Request {} |
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(Hours = 2, Region = "ReferenceData")] | |
public class GetAllCountriesRequest : Request | |
{ | |
private string dummyValue = typeof(GetAllCountriesRequest).FullName; | |
public bool Equals(GetAllCountriesRequest other) | |
{ | |
if (ReferenceEquals(null, other)) return false; | |
if (ReferenceEquals(this, other)) return true; | |
return Equals(other.dummyValue, dummyValue); | |
} | |
public override bool Equals(object obj) | |
{ | |
if (ReferenceEquals(null, obj)) return false; | |
if (ReferenceEquals(this, obj)) return true; | |
if (obj.GetType() != typeof(GetAllCountriesRequest)) return false; | |
return Equals((GetAllCountriesRequest)obj); | |
} | |
public override int GetHashCode() | |
{ | |
return dummyValue.GetHashCode(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment