{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Caching/pulls/comments/30221553","id":30221553,"diff_hunk":"@@ -0,0 +1,114 @@\n+﻿// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+using System;\n+using System.Collections.Generic;\n+using Microsoft.Framework.Caching.Memory;\n+\n+namespace Microsoft.Framework.Caching\n+{\n+    public class CacheEntryOptions\n+    {\n+        private DateTimeOffset? _absoluteExpiration;\n+        private TimeSpan? _absoluteExpirationRelativeToNow;\n+        private TimeSpan? _slidingExpiration;\n+\n+        public CacheEntryOptions()\n+        {\n+            Triggers = new List<IExpirationTrigger>();\n+            PostEvictionCallbacks = new List<PostEvictionCallbackRegistration>();\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets an absolute expiration date for the cache entry.\n+        /// </summary>\n+        public DateTimeOffset? AbsoluteExpiration\n+        {\n+            get\n+            {\n+                return _absoluteExpiration;\n+            }\n+            set\n+            {\n+                if (AbsoluteExpirationRelativeToNow != null)\n+                {\n+                    throw new InvalidOperationException(\n+                        $\"Cannot set both the properties '{nameof(AbsoluteExpirationRelativeToNow)}' \" +\n+                        $\"and '{nameof(AbsoluteExpiration)}' for absolute expiration time.\");\n+                }\n+\n+                _absoluteExpiration = value;\n+            }\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets an absolute expiration time, relative to now.\n+        /// </summary>\n+        public TimeSpan? AbsoluteExpirationRelativeToNow\n+        {\n+            get\n+            {\n+                return _absoluteExpirationRelativeToNow;\n+            }\n+            set\n+            {\n+                if (AbsoluteExpiration != null)\n+                {\n+                    throw new InvalidOperationException(\n+                        $\"Cannot set both the properties '{nameof(AbsoluteExpirationRelativeToNow)}' \" +\n+                        $\"and '{nameof(AbsoluteExpiration)}' for absolute expiration time.\");\n+                }\n+\n+                if (value <= TimeSpan.Zero)\n+                {\n+                    throw new ArgumentOutOfRangeException(\n+                        nameof(AbsoluteExpirationRelativeToNow),\n+                        value,\n+                        \"The relative expiration value must be positive.\");\n+                }\n+\n+                _absoluteExpirationRelativeToNow = value;\n+            }\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets how long a cache entry can be inactive (e.g. not accessed) before it will be removed.\n+        /// This will not extend the entry lifetime beyond the absolute expiration (if set).\n+        /// </summary>\n+        public TimeSpan? SlidingExpiration\n+        {\n+            get\n+            {\n+                return _slidingExpiration;\n+            }\n+            set\n+            {\n+                if (value <= TimeSpan.Zero)\n+                {\n+                    throw new ArgumentOutOfRangeException(\n+                        nameof(SlidingExpiration),\n+                        value,\n+                        \"The sliding expiration value must be positive.\");\n+                }\n+\n+                _slidingExpiration = value;\n+            }\n+        }\n+\n+        /// <summary>\n+        /// Gets or sets the events which are fired when the cache entry expires.\n+        /// </summary>\n+        public IList<IExpirationTrigger> Triggers { get; set; }","path":"src/Microsoft.Framework.Caching.Abstractions/CacheEntryOptions.cs","position":null,"original_position":101,"commit_id":"a9c2da7b22acdf3108cbbb277689a29e2f7b259c","original_commit_id":"f6190823357f9bcb19c2026e4c1f275275a3e669","user":{"login":"davidfowl","id":95136,"avatar_url":"https://avatars.githubusercontent.com/u/95136?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfowl","html_url":"https://github.com/davidfowl","followers_url":"https://api.github.com/users/davidfowl/followers","following_url":"https://api.github.com/users/davidfowl/following{/other_user}","gists_url":"https://api.github.com/users/davidfowl/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfowl/subscriptions","organizations_url":"https://api.github.com/users/davidfowl/orgs","repos_url":"https://api.github.com/users/davidfowl/repos","events_url":"https://api.github.com/users/davidfowl/events{/privacy}","received_events_url":"https://api.github.com/users/davidfowl/received_events","type":"User","site_admin":false},"body":"YES!","created_at":"2015-05-13T11:21:47Z","updated_at":"2015-05-13T11:21:47Z","html_url":"https://github.com/aspnet/Caching/pull/66#discussion_r30221553","pull_request_url":"https://api.github.com/repos/aspnet/Caching/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Caching/pulls/comments/30221553"},"html":{"href":"https://github.com/aspnet/Caching/pull/66#discussion_r30221553"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Caching/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Caching/pulls/66","id":35276205,"html_url":"https://github.com/aspnet/Caching/pull/66","diff_url":"https://github.com/aspnet/Caching/pull/66.diff","patch_url":"https://github.com/aspnet/Caching/pull/66.patch","issue_url":"https://api.github.com/repos/aspnet/Caching/issues/66","number":66,"state":"open","locked":false,"title":"Caching api review changes - Part 1","user":{"login":"kichalla","id":6559784,"avatar_url":"https://avatars.githubusercontent.com/u/6559784?v=3","gravatar_id":"","url":"https://api.github.com/users/kichalla","html_url":"https://github.com/kichalla","followers_url":"https://api.github.com/users/kichalla/followers","following_url":"https://api.github.com/users/kichalla/following{/other_user}","gists_url":"https://api.github.com/users/kichalla/gists{/gist_id}","starred_url":"https://api.github.com/users/kichalla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kichalla/subscriptions","organizations_url":"https://api.github.com/users/kichalla/orgs","repos_url":"https://api.github.com/users/kichalla/repos","events_url":"https://api.github.com/users/kichalla/events{/privacy}","received_events_url":"https://api.github.com/users/kichalla/received_events","type":"User","site_admin":false},"body":"@Tratcher\r\n\r\nPlease note:\r\n- I am not handling all EntryLink changes in this PR\r\n- The changes to Redis cache implementation is incomplete...wanted to get initial input on the MemoryCache changes.","created_at":"2015-05-12T22:09:46Z","updated_at":"2015-05-13T11:21:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2eeeace9f787ea0fb22dc3ff25a6f01948cf705","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Caching/pulls/66/commits","review_comments_url":"https://api.github.com/repos/aspnet/Caching/pulls/66/comments","review_comment_url":"https://api.github.com/repos/aspnet/Caching/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Caching/issues/66/comments","statuses_url":"https://api.github.com/repos/aspnet/Caching/statuses/a9c2da7b22acdf3108cbbb277689a29e2f7b259c","head":{"label":"aspnet:kiran/caching-changes","ref":"kiran/caching-changes","sha":"a9c2da7b22acdf3108cbbb277689a29e2f7b259c","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":22390590,"name":"Caching","full_name":"aspnet/Caching","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Caching","description":"Libraries for caching, including in-memory caching, distributed caching, and ASP.NET session caching.","fork":false,"url":"https://api.github.com/repos/aspnet/Caching","forks_url":"https://api.github.com/repos/aspnet/Caching/forks","keys_url":"https://api.github.com/repos/aspnet/Caching/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Caching/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Caching/teams","hooks_url":"https://api.github.com/repos/aspnet/Caching/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Caching/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Caching/events","assignees_url":"https://api.github.com/repos/aspnet/Caching/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Caching/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Caching/tags","blobs_url":"https://api.github.com/repos/aspnet/Caching/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Caching/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Caching/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Caching/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Caching/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Caching/languages","stargazers_url":"https://api.github.com/repos/aspnet/Caching/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Caching/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Caching/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Caching/subscription","commits_url":"https://api.github.com/repos/aspnet/Caching/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Caching/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Caching/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Caching/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Caching/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Caching/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Caching/merges","archive_url":"https://api.github.com/repos/aspnet/Caching/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Caching/downloads","issues_url":"https://api.github.com/repos/aspnet/Caching/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Caching/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Caching/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Caching/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Caching/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Caching/releases{/id}","created_at":"2014-07-29T18:25:32Z","updated_at":"2015-05-11T20:22:31Z","pushed_at":"2015-05-13T07:25:37Z","git_url":"git://github.com/aspnet/Caching.git","ssh_url":"git@github.com:aspnet/Caching.git","clone_url":"https://github.com/aspnet/Caching.git","svn_url":"https://github.com/aspnet/Caching","homepage":"","size":1713,"stargazers_count":66,"watchers_count":66,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":15,"forks":23,"open_issues":15,"watchers":66,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"7459e55cb255899414422cb56144643ff5555149","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":22390590,"name":"Caching","full_name":"aspnet/Caching","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Caching","description":"Libraries for caching, including in-memory caching, distributed caching, and ASP.NET session caching.","fork":false,"url":"https://api.github.com/repos/aspnet/Caching","forks_url":"https://api.github.com/repos/aspnet/Caching/forks","keys_url":"https://api.github.com/repos/aspnet/Caching/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Caching/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Caching/teams","hooks_url":"https://api.github.com/repos/aspnet/Caching/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Caching/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Caching/events","assignees_url":"https://api.github.com/repos/aspnet/Caching/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Caching/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Caching/tags","blobs_url":"https://api.github.com/repos/aspnet/Caching/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Caching/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Caching/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Caching/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Caching/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Caching/languages","stargazers_url":"https://api.github.com/repos/aspnet/Caching/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Caching/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Caching/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Caching/subscription","commits_url":"https://api.github.com/repos/aspnet/Caching/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Caching/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Caching/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Caching/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Caching/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Caching/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Caching/merges","archive_url":"https://api.github.com/repos/aspnet/Caching/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Caching/downloads","issues_url":"https://api.github.com/repos/aspnet/Caching/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Caching/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Caching/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Caching/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Caching/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Caching/releases{/id}","created_at":"2014-07-29T18:25:32Z","updated_at":"2015-05-11T20:22:31Z","pushed_at":"2015-05-13T07:25:37Z","git_url":"git://github.com/aspnet/Caching.git","ssh_url":"git@github.com:aspnet/Caching.git","clone_url":"https://github.com/aspnet/Caching.git","svn_url":"https://github.com/aspnet/Caching","homepage":"","size":1713,"stargazers_count":66,"watchers_count":66,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":15,"forks":23,"open_issues":15,"watchers":66,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Caching/pulls/66"},"html":{"href":"https://github.com/aspnet/Caching/pull/66"},"issue":{"href":"https://api.github.com/repos/aspnet/Caching/issues/66"},"comments":{"href":"https://api.github.com/repos/aspnet/Caching/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Caching/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Caching/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Caching/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Caching/statuses/a9c2da7b22acdf3108cbbb277689a29e2f7b259c"}}}}