{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/10574","repository_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore","labels_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/10574/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/10574/comments","events_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/10574/events","html_url":"https://github.com/aspnet/EntityFrameworkCore/issues/10574","id":282594035,"number":10574,"title":"Feature Request: Ability To pass a bag of shadow properties when attaching entities to dbcontext ","user":{"login":"Tarig0","id":4108180,"avatar_url":"https://avatars3.githubusercontent.com/u/4108180?v=4","gravatar_id":"","url":"https://api.github.com/users/Tarig0","html_url":"https://github.com/Tarig0","followers_url":"https://api.github.com/users/Tarig0/followers","following_url":"https://api.github.com/users/Tarig0/following{/other_user}","gists_url":"https://api.github.com/users/Tarig0/gists{/gist_id}","starred_url":"https://api.github.com/users/Tarig0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tarig0/subscriptions","organizations_url":"https://api.github.com/users/Tarig0/orgs","repos_url":"https://api.github.com/users/Tarig0/repos","events_url":"https://api.github.com/users/Tarig0/events{/privacy}","received_events_url":"https://api.github.com/users/Tarig0/received_events","type":"User","site_admin":false},"labels":[{"id":403965595,"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/labels/closed-question","name":"closed-question","color":"777777","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-12-16T02:41:40Z","updated_at":"2017-12-21T18:26:01Z","closed_at":"2017-12-18T17:13:55Z","author_association":"NONE","body":"I have ran into a few times when I had to work around using FK shadow properties where I would have to initialize the principle entities with minimal data and attach my target entity before adding the principle entity to the change tracker.\r\n\r\nTo make this easier I would like to request the ability to add a param list to the Add/Update/Remove/Attach functions to allow us to manually inject shadow properties."},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/comments/353422390","html_url":"https://github.com/aspnet/EntityFrameworkCore/issues/10574#issuecomment-353422390","issue_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/10574","id":353422390,"user":{"login":"Tarig0","id":4108180,"avatar_url":"https://avatars3.githubusercontent.com/u/4108180?v=4","gravatar_id":"","url":"https://api.github.com/users/Tarig0","html_url":"https://github.com/Tarig0","followers_url":"https://api.github.com/users/Tarig0/followers","following_url":"https://api.github.com/users/Tarig0/following{/other_user}","gists_url":"https://api.github.com/users/Tarig0/gists{/gist_id}","starred_url":"https://api.github.com/users/Tarig0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tarig0/subscriptions","organizations_url":"https://api.github.com/users/Tarig0/orgs","repos_url":"https://api.github.com/users/Tarig0/repos","events_url":"https://api.github.com/users/Tarig0/events{/privacy}","received_events_url":"https://api.github.com/users/Tarig0/received_events","type":"User","site_admin":false},"created_at":"2017-12-21T18:26:00Z","updated_at":"2017-12-21T18:26:00Z","author_association":"NONE","body":"Think the last one may be incorrect\r\nThis works for me\r\n```c#\r\nvar e = _lablesDB.Entry(new KeyNomenclature() { Order = k.Order, RuleType = k.RuleType });\r\n                    e.CurrentValues.SetValues(new Dictionary<string, object>() {\r\n                        { nameof(ProductLine.ProductLineName), productLineName },\r\n                        { nameof(Nomenclature.Guid), k.Nomenclature.Guid }\r\n                    });\r\n                    e.State=EntityState.Added;\r\n```\r\nThis doesn't pickup the shadow properties\r\n```c#\r\nvar e = new KeyNomenclature() { Order = k.Order, RuleType = k.RuleType };\r\n                    _lablesDB.Entry(e).CurrentValues.SetValues(new Dictionary<string, object>() {\r\n                        { nameof(ProductLine.ProductLineName), productLineName },\r\n                        { nameof(Nomenclature.Guid), k.Nomenclature.Guid }\r\n                    });\r\n                    _lablesDB.Add(e);\r\n```"}}
{"actor":{"display_login":"Tarig0"}}