{"action":"opened","issue":{"url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/226","repository_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator","labels_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/226/comments","events_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/226/events","html_url":"https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/226","id":211812564,"number":226,"title":"Question about FakeDbContext","user":{"login":"pablorivassanchez","id":20487828,"avatar_url":"https://avatars2.githubusercontent.com/u/20487828?v=3","gravatar_id":"","url":"https://api.github.com/users/pablorivassanchez","html_url":"https://github.com/pablorivassanchez","followers_url":"https://api.github.com/users/pablorivassanchez/followers","following_url":"https://api.github.com/users/pablorivassanchez/following{/other_user}","gists_url":"https://api.github.com/users/pablorivassanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/pablorivassanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pablorivassanchez/subscriptions","organizations_url":"https://api.github.com/users/pablorivassanchez/orgs","repos_url":"https://api.github.com/users/pablorivassanchez/repos","events_url":"https://api.github.com/users/pablorivassanchez/events{/privacy}","received_events_url":"https://api.github.com/users/pablorivassanchez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-03T21:56:15Z","updated_at":"2017-03-03T21:56:15Z","closed_at":null,"body":"Hello,\r\n\r\nI have a little problem trying to using the FakeDbContext that is generated with the Template. I am doing some relations with DataAnnotation (forcing a foreign key), here is an example:\r\n\r\n```\r\npublic class Program\r\n{\r\npublic int ProgramId{get;set;}\r\npublic int? TypeId{get;set;}\r\n[ForeignKey(\"TypeId\")]\r\npublic Type ProgramType{get;set;}\r\n}\r\n\r\npublic class Type\r\n{\r\npublic int TypeId{get;set;}\r\npublic string Name{get;set;}\r\n}\r\n```\r\n\r\nThe relation is not in the real database (these are not the tables but are similars). When I'm doing the unit test like that:\r\n\r\n```\r\nusing (var context = new FakeDbContext())\r\n {\r\n                context.Type.Add(new Type() { TypeId= 1, Name= \"Test\" });\r\n                context.Program.Add(new Program() { ProgramId= 125, TypeId= 1});\r\n                var resultado = context.Program.Include(x=>x.ProgramType).ToList();         \r\n}\r\n```\r\n\r\nI don't get the Type pulled into ProgramType. It is possible to make that work like that?\r\n\r\nThanks in advance.\r\n"}}
{"actor":{"display_login":"pablorivassanchez"}}