{"action":"created","issue":{"url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/158","repository_url":"https://api.github.com/repos/leekelleher/umbraco-ditto","labels_url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/158/comments","events_url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/158/events","html_url":"https://github.com/leekelleher/umbraco-ditto/issues/158","id":143373367,"number":158,"title":"Question:  ValueResolverContext for Lazy ProperyValueResolvers","user":{"login":"rustyswayne","id":1865016,"avatar_url":"https://avatars.githubusercontent.com/u/1865016?v=3","gravatar_id":"","url":"https://api.github.com/users/rustyswayne","html_url":"https://github.com/rustyswayne","followers_url":"https://api.github.com/users/rustyswayne/followers","following_url":"https://api.github.com/users/rustyswayne/following{/other_user}","gists_url":"https://api.github.com/users/rustyswayne/gists{/gist_id}","starred_url":"https://api.github.com/users/rustyswayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustyswayne/subscriptions","organizations_url":"https://api.github.com/users/rustyswayne/orgs","repos_url":"https://api.github.com/users/rustyswayne/repos","events_url":"https://api.github.com/users/rustyswayne/events{/privacy}","received_events_url":"https://api.github.com/users/rustyswayne/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/leekelleher/umbraco-ditto/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/leekelleher/umbraco-ditto/labels/discussion","name":"discussion","color":"cc317c"},{"url":"https://api.github.com/repos/leekelleher/umbraco-ditto/labels/testing","name":"testing","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"leekelleher","id":209066,"avatar_url":"https://avatars.githubusercontent.com/u/209066?v=3","gravatar_id":"","url":"https://api.github.com/users/leekelleher","html_url":"https://github.com/leekelleher","followers_url":"https://api.github.com/users/leekelleher/followers","following_url":"https://api.github.com/users/leekelleher/following{/other_user}","gists_url":"https://api.github.com/users/leekelleher/gists{/gist_id}","starred_url":"https://api.github.com/users/leekelleher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leekelleher/subscriptions","organizations_url":"https://api.github.com/users/leekelleher/orgs","repos_url":"https://api.github.com/users/leekelleher/repos","events_url":"https://api.github.com/users/leekelleher/events{/privacy}","received_events_url":"https://api.github.com/users/leekelleher/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-03-24T22:09:24Z","updated_at":"2016-04-11T16:58:50Z","closed_at":null,"body":"Hey guys,\r\n\r\nI'm working on a multi site implementation where I pass around a \"SiteAlias\" in ValueResolveContext.  It all works great until I hit a property that is marked virtual so Lazy (proxy object).  I expected that the instantiated context that I passed into the do the initial model conversion would be used when converting the Lazy properties later, but it appears that a new instance of the ValueResolveContext is being instantiated instead.\r\n\r\nAm I missing something in the way I'm using the contexts or is it by design?  \r\n\r\nI looked at using an OnConverting method, but it does not expose the context in the handler.\r\n\r\nIs there another way to accomplish this?  I've come up with a hack that which I shove stuff into the request cache but it seems pretty wonky. =)"},"comment":{"url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/comments/208449395","html_url":"https://github.com/leekelleher/umbraco-ditto/issues/158#issuecomment-208449395","issue_url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/158","id":208449395,"user":{"login":"leekelleher","id":209066,"avatar_url":"https://avatars.githubusercontent.com/u/209066?v=3","gravatar_id":"","url":"https://api.github.com/users/leekelleher","html_url":"https://github.com/leekelleher","followers_url":"https://api.github.com/users/leekelleher/followers","following_url":"https://api.github.com/users/leekelleher/following{/other_user}","gists_url":"https://api.github.com/users/leekelleher/gists{/gist_id}","starred_url":"https://api.github.com/users/leekelleher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leekelleher/subscriptions","organizations_url":"https://api.github.com/users/leekelleher/orgs","repos_url":"https://api.github.com/users/leekelleher/repos","events_url":"https://api.github.com/users/leekelleher/events{/privacy}","received_events_url":"https://api.github.com/users/leekelleher/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T16:58:50Z","updated_at":"2016-04-11T16:58:50Z","body":"I've made a spike-branch from 0.8.4 tag (from the \"master\" branch) to try to replicate this scenario.\r\n\r\nUpdated our existing `ValueResolverContextTests` unit-test on this commit: 1caea769c0601d0c030292bc67182e1b0e3f7d15\r\n\r\nUnfortunately I can't reproduce the issue, the custom `ValueResolverContext` is populated when used by a `virtual`/lazy-loaded property.\r\n\r\nUnless I'm missing something here?  (Feel free to modify the unit-test in the spike-branch accordingly)"}}