{"action":"closed","issue":{"url":"https://api.github.com/repos/TurnerSoftware/MongoFramework/issues/12","repository_url":"https://api.github.com/repos/TurnerSoftware/MongoFramework","labels_url":"https://api.github.com/repos/TurnerSoftware/MongoFramework/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/TurnerSoftware/MongoFramework/issues/12/comments","events_url":"https://api.github.com/repos/TurnerSoftware/MongoFramework/issues/12/events","html_url":"https://github.com/TurnerSoftware/MongoFramework/issues/12","id":292198918,"number":12,"title":"Add \"Navigational Properties\" support like EF","user":{"login":"Turnerj","id":904226,"avatar_url":"https://avatars1.githubusercontent.com/u/904226?v=4","gravatar_id":"","url":"https://api.github.com/users/Turnerj","html_url":"https://github.com/Turnerj","followers_url":"https://api.github.com/users/Turnerj/followers","following_url":"https://api.github.com/users/Turnerj/following{/other_user}","gists_url":"https://api.github.com/users/Turnerj/gists{/gist_id}","starred_url":"https://api.github.com/users/Turnerj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turnerj/subscriptions","organizations_url":"https://api.github.com/users/Turnerj/orgs","repos_url":"https://api.github.com/users/Turnerj/repos","events_url":"https://api.github.com/users/Turnerj/events{/privacy}","received_events_url":"https://api.github.com/users/Turnerj/received_events","type":"User","site_admin":false},"labels":[{"id":512282737,"url":"https://api.github.com/repos/TurnerSoftware/MongoFramework/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/TurnerSoftware/MongoFramework/milestones/1","html_url":"https://github.com/TurnerSoftware/MongoFramework/milestone/1","labels_url":"https://api.github.com/repos/TurnerSoftware/MongoFramework/milestones/1/labels","id":2871489,"number":1,"title":"Version 1","description":"","creator":{"login":"Turnerj","id":904226,"avatar_url":"https://avatars1.githubusercontent.com/u/904226?v=4","gravatar_id":"","url":"https://api.github.com/users/Turnerj","html_url":"https://github.com/Turnerj","followers_url":"https://api.github.com/users/Turnerj/followers","following_url":"https://api.github.com/users/Turnerj/following{/other_user}","gists_url":"https://api.github.com/users/Turnerj/gists{/gist_id}","starred_url":"https://api.github.com/users/Turnerj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turnerj/subscriptions","organizations_url":"https://api.github.com/users/Turnerj/orgs","repos_url":"https://api.github.com/users/Turnerj/repos","events_url":"https://api.github.com/users/Turnerj/events{/privacy}","received_events_url":"https://api.github.com/users/Turnerj/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":8,"state":"open","created_at":"2017-10-28T12:59:45Z","updated_at":"2018-04-15T07:50:13Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-01-28T11:56:02Z","updated_at":"2018-04-15T07:50:13Z","closed_at":"2018-04-15T07:50:12Z","author_association":"OWNER","body":"Changes tracked in: https://github.com/TurnerSoftware/MongoFramework/tree/ef-navigation-properties\r\n\r\nWhile a document-based database can store nested data, you may not want to store all objects in a nested fashion. You can add foreign keys on entities and manually query them currently however it can be useful to be able to access the related entity through a navigational property.\r\n\r\nIn Entity Framework, this is achieved through the use of `virtual` properties where it instantiates a proxy that can do the required lookup. It supports both eager loading (specifically defining which objects you want data for) and lazy loading.\r\n\r\nWhile it isn't a good idea to shoehorn every relational database feature from EF into MongoFramework, there is some utility in some of the functionality.\r\n\r\nIt shouldn't be very difficult to support a `1..n` relationship through virtual properties like `virtual ICollection<Post> Posts { get; set; }`. Currently I'm not sure how to implement a `1..1` relationship through the same method as EF does some magic behind the scenes.\r\n\r\nRight now, it doesn't seem to make sense to support eager loading as I can't see it improving performance.\r\n\r\nAt minimum I see the following things needed:\r\n- Custom Linq processor that instantiates the proxy class (eg. `ICollection<Post>`)\r\n- Updates to valid mappings, need to prevent virtual properties from being considered part of the BSON mapping\r\n- New mapping processor to pick up new attributes part of the DataAnnotations namespace\r\n- Potential updates to change tracking (virtual properties shouldn't count as changes - this might be accomplished with mapping updates)\r\n\r\nThis is a nice feature to add but will need to be careful to make sure it generally works the same way as EF. If it has minor differences, that's fine. If it has major differences, it might be worth re-considering this functionality."}}
{"actor":{"display_login":"Turnerj"}}