{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2829","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2829/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2829/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2829/events","html_url":"https://github.com/Starcounter/Starcounter/issues/2829","id":98902979,"number":2829,"title":"Support Starcounter.Extensions classes when running star.exe with source code","user":{"login":"per-samuelsson","id":2902045,"avatar_url":"https://avatars.githubusercontent.com/u/2902045?v=3","gravatar_id":"","url":"https://api.github.com/users/per-samuelsson","html_url":"https://github.com/per-samuelsson","followers_url":"https://api.github.com/users/per-samuelsson/followers","following_url":"https://api.github.com/users/per-samuelsson/following{/other_user}","gists_url":"https://api.github.com/users/per-samuelsson/gists{/gist_id}","starred_url":"https://api.github.com/users/per-samuelsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/per-samuelsson/subscriptions","organizations_url":"https://api.github.com/users/per-samuelsson/orgs","repos_url":"https://api.github.com/users/per-samuelsson/repos","events_url":"https://api.github.com/users/per-samuelsson/events{/privacy}","received_events_url":"https://api.github.com/users/per-samuelsson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/Command-line","name":"Command-line","color":"000000"},{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"per-samuelsson","id":2902045,"avatar_url":"https://avatars.githubusercontent.com/u/2902045?v=3","gravatar_id":"","url":"https://api.github.com/users/per-samuelsson","html_url":"https://github.com/per-samuelsson","followers_url":"https://api.github.com/users/per-samuelsson/followers","following_url":"https://api.github.com/users/per-samuelsson/following{/other_user}","gists_url":"https://api.github.com/users/per-samuelsson/gists{/gist_id}","starred_url":"https://api.github.com/users/per-samuelsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/per-samuelsson/subscriptions","organizations_url":"https://api.github.com/users/per-samuelsson/orgs","repos_url":"https://api.github.com/users/per-samuelsson/repos","events_url":"https://api.github.com/users/per-samuelsson/events{/privacy}","received_events_url":"https://api.github.com/users/per-samuelsson/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Starcounter/Starcounter/milestones/51","html_url":"https://github.com/Starcounter/Starcounter/milestones/v2.0","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/milestones/51/labels","id":602455,"number":51,"title":"v2.0","description":"","creator":{"login":"Starcounter-Jack","id":1219049,"avatar_url":"https://avatars.githubusercontent.com/u/1219049?v=3","gravatar_id":"","url":"https://api.github.com/users/Starcounter-Jack","html_url":"https://github.com/Starcounter-Jack","followers_url":"https://api.github.com/users/Starcounter-Jack/followers","following_url":"https://api.github.com/users/Starcounter-Jack/following{/other_user}","gists_url":"https://api.github.com/users/Starcounter-Jack/gists{/gist_id}","starred_url":"https://api.github.com/users/Starcounter-Jack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starcounter-Jack/subscriptions","organizations_url":"https://api.github.com/users/Starcounter-Jack/orgs","repos_url":"https://api.github.com/users/Starcounter-Jack/repos","events_url":"https://api.github.com/users/Starcounter-Jack/events{/privacy}","received_events_url":"https://api.github.com/users/Starcounter-Jack/received_events","type":"User","site_admin":false},"open_issues":343,"closed_issues":417,"state":"open","created_at":"2014-03-19T09:04:00Z","updated_at":"2015-10-04T13:57:37Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-08-04T06:55:56Z","updated_at":"2015-10-08T07:29:25Z","closed_at":"2015-08-04T19:50:31Z","body":"When passing source code to `star.exe`, its currently not possible to reference the new `Starcounter.Extensions` classes. This need to be supported.\r\n\r\nCC @alemoi "},"comment":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/comments/146442898","html_url":"https://github.com/Starcounter/Starcounter/issues/2829#issuecomment-146442898","issue_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2829","id":146442898,"user":{"login":"warpech","id":566463,"avatar_url":"https://avatars.githubusercontent.com/u/566463?v=3","gravatar_id":"","url":"https://api.github.com/users/warpech","html_url":"https://github.com/warpech","followers_url":"https://api.github.com/users/warpech/followers","following_url":"https://api.github.com/users/warpech/following{/other_user}","gists_url":"https://api.github.com/users/warpech/gists{/gist_id}","starred_url":"https://api.github.com/users/warpech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warpech/subscriptions","organizations_url":"https://api.github.com/users/warpech/orgs","repos_url":"https://api.github.com/users/warpech/repos","events_url":"https://api.github.com/users/warpech/events{/privacy}","received_events_url":"https://api.github.com/users/warpech/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T07:29:25Z","updated_at":"2015-10-08T07:29:25Z","body":"There is 2 reasons why we use code in maps:\r\n\r\n#### 1. Used already: Conditional mapping\r\n\r\nMeaning: Checking if the map should be used in a particular context. For example, I might want to display a partial only if a Product is part of the relation:\r\n\r\n```\r\n                Relation rel = DbHelper.FromID(DbHelper.Base64DecodeObjectID(objectId)) as Relation;\r\n\r\n                if (rel.WhatIs != null && rel.WhatIs.GetType() == typeof(Product)) {\r\n                    return rel.WhatIs.Key;\r\n                }\r\n\r\n                return null;\r\n```\r\n\r\nSuch code is currently in the maps, but there is no problem to move it to the partial handlers. @miyconst - anything to add here?\r\n\r\n#### 2. Potential future use: Access control\r\n\r\nAs in: *does the current user have access to see the purchase price of the product?*.\r\n\r\nI thought that code in maps would be a great way to solve such problems. But if we cannot use code in maps, then what's left? Some trait-based mapping? @dan31 your advise welcome"}}