{"comment":{"url":"https://api.github.com/repos/silvernetgroup/GieldaWeb/comments/14262431","html_url":"https://github.com/silvernetgroup/GieldaWeb/commit/39d294e3e1cf68f9f26f1136b01d8f23bc7dd927#commitcomment-14262431","id":14262431,"user":{"login":"Sylwekqaz","id":8068490,"avatar_url":"https://avatars.githubusercontent.com/u/8068490?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylwekqaz","html_url":"https://github.com/Sylwekqaz","followers_url":"https://api.github.com/users/Sylwekqaz/followers","following_url":"https://api.github.com/users/Sylwekqaz/following{/other_user}","gists_url":"https://api.github.com/users/Sylwekqaz/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylwekqaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylwekqaz/subscriptions","organizations_url":"https://api.github.com/users/Sylwekqaz/orgs","repos_url":"https://api.github.com/users/Sylwekqaz/repos","events_url":"https://api.github.com/users/Sylwekqaz/events{/privacy}","received_events_url":"https://api.github.com/users/Sylwekqaz/received_events","type":"User","site_admin":false},"position":9,"line":9,"path":"src/Core/Domain/Entities/Comment.cs","commit_id":"39d294e3e1cf68f9f26f1136b01d8f23bc7dd927","created_at":"2015-11-08T11:30:26Z","updated_at":"2015-11-08T11:30:26Z","body":"Możesz dodać jeszcze \r\n`public Project Project{ get; set; }`\r\nwtedy ef zmapuje powiązany projekt.\r\nOdwrotną property nawigacyjną dodaj do projektu\r\n```        public Project()\r\n        {\r\n            Comments = new List<Comment>();\r\n        }\r\n...\r\npublic virtual ICollection<Comment> Comments { get; set; } ```\r\ni w CoreDbContext \r\n```        protected override void OnModelCreating(DbModelBuilder modelBuilder)\r\n        {\r\n            base.OnModelCreating(modelBuilder);\r\n\r\n            modelBuilder.Entity<Project>()\r\n                .HasMany(project => project.Comments)\r\n                .WithRequired(Comment => Comment.Project)\r\n                .HasForeignKey(comment => comment.ProjectId);\r\n        }\r\n```"}}