{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/998","repository_url":"https://api.github.com/repos/Starcounter/Starcounter","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/998/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/998/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/998/events","html_url":"https://github.com/Starcounter/Starcounter/issues/998","id":19446621,"number":998,"title":"Starcounter database classes does not support TimeSpan fields or properties","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":[{"id":34563271,"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/.NET","name":".NET","color":"000000","default":false},{"id":34564268,"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/Bluestar","name":"Bluestar","color":"000000","default":false},{"id":4413437,"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":43650003,"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/guess:%20%3C%20day","name":"guess: < day","color":"c7def8","default":false},{"id":4413439,"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/question","name":"question","color":"02d7e1","default":true},{"id":34566885,"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/SQL","name":"SQL","color":"000000","default":false}],"state":"open","locked":false,"assignee":{"login":"k-rus","id":1726044,"avatar_url":"https://avatars.githubusercontent.com/u/1726044?v=3","gravatar_id":"","url":"https://api.github.com/users/k-rus","html_url":"https://github.com/k-rus","followers_url":"https://api.github.com/users/k-rus/followers","following_url":"https://api.github.com/users/k-rus/following{/other_user}","gists_url":"https://api.github.com/users/k-rus/gists{/gist_id}","starred_url":"https://api.github.com/users/k-rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-rus/subscriptions","organizations_url":"https://api.github.com/users/k-rus/orgs","repos_url":"https://api.github.com/users/k-rus/repos","events_url":"https://api.github.com/users/k-rus/events{/privacy}","received_events_url":"https://api.github.com/users/k-rus/received_events","type":"User","site_admin":false},"assignees":[{"login":"k-rus","id":1726044,"avatar_url":"https://avatars.githubusercontent.com/u/1726044?v=3","gravatar_id":"","url":"https://api.github.com/users/k-rus","html_url":"https://github.com/k-rus","followers_url":"https://api.github.com/users/k-rus/followers","following_url":"https://api.github.com/users/k-rus/following{/other_user}","gists_url":"https://api.github.com/users/k-rus/gists{/gist_id}","starred_url":"https://api.github.com/users/k-rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-rus/subscriptions","organizations_url":"https://api.github.com/users/k-rus/orgs","repos_url":"https://api.github.com/users/k-rus/repos","events_url":"https://api.github.com/users/k-rus/events{/privacy}","received_events_url":"https://api.github.com/users/k-rus/received_events","type":"User","site_admin":false},{"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/53","html_url":"https://github.com/Starcounter/Starcounter/milestone/53","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/milestones/53/labels","id":641803,"number":53,"title":"Backlog","description":"","creator":{"login":"dan31","id":7162535,"avatar_url":"https://avatars.githubusercontent.com/u/7162535?v=3","gravatar_id":"","url":"https://api.github.com/users/dan31","html_url":"https://github.com/dan31","followers_url":"https://api.github.com/users/dan31/followers","following_url":"https://api.github.com/users/dan31/following{/other_user}","gists_url":"https://api.github.com/users/dan31/gists{/gist_id}","starred_url":"https://api.github.com/users/dan31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan31/subscriptions","organizations_url":"https://api.github.com/users/dan31/orgs","repos_url":"https://api.github.com/users/dan31/repos","events_url":"https://api.github.com/users/dan31/events{/privacy}","received_events_url":"https://api.github.com/users/dan31/received_events","type":"User","site_admin":false},"open_issues":97,"closed_issues":78,"state":"open","created_at":"2014-04-27T22:20:10Z","updated_at":"2016-12-16T09:19:02Z","due_on":"2045-11-07T00:00:00Z","closed_at":null},"comments":10,"created_at":"2013-09-13T13:11:13Z","updated_at":"2016-12-19T14:46:27Z","closed_at":null,"body":"As I noticed in issue #995, `TimeSpan` data fields are no longer supported by the Starcounter code host / database manager. They used to be (I'm quite sure of).\n\nAlso, we don't even support properties with this datatype. Hence, the following database class is invalid and won't allow the executable containing it to load:\n\n``` c#\n[Database] public class Foo {\n  public TimeSpan Bar { get { return TimeSpan.FromDays(31); } }\n}\n```\n\nI think we should consider supporting this.\n"},"comment":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/comments/267981304","html_url":"https://github.com/Starcounter/Starcounter/issues/998#issuecomment-267981304","issue_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/998","id":267981304,"user":{"login":"k-rus","id":1726044,"avatar_url":"https://avatars.githubusercontent.com/u/1726044?v=3","gravatar_id":"","url":"https://api.github.com/users/k-rus","html_url":"https://github.com/k-rus","followers_url":"https://api.github.com/users/k-rus/followers","following_url":"https://api.github.com/users/k-rus/following{/other_user}","gists_url":"https://api.github.com/users/k-rus/gists{/gist_id}","starred_url":"https://api.github.com/users/k-rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-rus/subscriptions","organizations_url":"https://api.github.com/users/k-rus/orgs","repos_url":"https://api.github.com/users/k-rus/repos","events_url":"https://api.github.com/users/k-rus/events{/privacy}","received_events_url":"https://api.github.com/users/k-rus/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T14:46:27Z","updated_at":"2016-12-19T14:46:27Z","body":"> Maybe we can make an attempt to see if we can support it the way we planned to - to extend the code host to support arbitrary data types as long as they support representing themselves as one of the primitives. I'm not sure what will be the effect if you try to query on it though.\r\n\r\nTo support `TimeSpan` or any arbitrary data type means to write conversion functions into basic database types and back. For this, it is necessary to identify, which method of a data type returns values to store and which constructor to use on creation when value converted back. \r\n\r\nFor example, for `TimeSpan` the conversion function can store value of ticks in `long` and can retrieve it using [TimeSpan.Ticks()](https://msdn.microsoft.com/en-us/library/system.timespan.ticks(v=vs.110).aspx). On the way back the conversion can use [TimeSpan(long ticks](https://msdn.microsoft.com/en-us/library/zz841zbz(v=vs.110).aspx).\r\n\r\nSo supporting each data type requires manual work to at least specify getter and constructor."}}
{"actor":{"display_login":"k-rus"}}