{"action":"created","issue":{"url":"https://api.github.com/repos/BlueshiftSoftware/EntityFrameworkCore/issues/23","repository_url":"https://api.github.com/repos/BlueshiftSoftware/EntityFrameworkCore","labels_url":"https://api.github.com/repos/BlueshiftSoftware/EntityFrameworkCore/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/BlueshiftSoftware/EntityFrameworkCore/issues/23/comments","events_url":"https://api.github.com/repos/BlueshiftSoftware/EntityFrameworkCore/issues/23/events","html_url":"https://github.com/BlueshiftSoftware/EntityFrameworkCore/issues/23","id":342758235,"node_id":"MDU6SXNzdWUzNDI3NTgyMzU=","number":23,"title":"Updating a Child \"Document\" inside array","user":{"login":"samofwise","id":10251056,"node_id":"MDQ6VXNlcjEwMjUxMDU2","avatar_url":"https://avatars0.githubusercontent.com/u/10251056?v=4","gravatar_id":"","url":"https://api.github.com/users/samofwise","html_url":"https://github.com/samofwise","followers_url":"https://api.github.com/users/samofwise/followers","following_url":"https://api.github.com/users/samofwise/following{/other_user}","gists_url":"https://api.github.com/users/samofwise/gists{/gist_id}","starred_url":"https://api.github.com/users/samofwise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samofwise/subscriptions","organizations_url":"https://api.github.com/users/samofwise/orgs","repos_url":"https://api.github.com/users/samofwise/repos","events_url":"https://api.github.com/users/samofwise/events{/privacy}","received_events_url":"https://api.github.com/users/samofwise/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-19T14:40:56Z","updated_at":"2018-12-19T20:42:24Z","closed_at":"2018-12-19T20:42:24Z","author_association":"NONE","body":"I am wondering how I would go about updating an child instance in an array?\r\n\r\nHere are my models\r\n\r\n```\r\npublic class Recording\r\n{\r\n\t[BsonId]\r\n\t[Key]\r\n\t[DatabaseGenerated(DatabaseGeneratedOption.Identity)]\r\n\tpublic ObjectId Id { get; set; }\r\n\t\t\r\n\t//Other Properties\r\n\r\n\tpublic List<VideoFragment> VideoFragments { get; set; } = new List<VideoFragment>();\r\n}\r\n```\r\n```\r\n[ComplexType]\r\npublic class VideoFragment\r\n{\r\n\tpublic string Url { get; set; }\r\n\tpublic byte[] Data { get; set; }\r\n}\r\n```\r\n\r\nHere is my Context\r\n```\r\npublic class MyDbContext : DbContext\r\n{\r\n\tpublic StreamcorderDbContext(DbContextOptions options) : base(options)\r\n\t{ }\r\n\r\n\tpublic DbSet<Recording> Recordings { get; set; }\r\n}\r\n```\r\n\r\nI am wanting to update an existing Video Fragment by looking it up by Url then saving a byte array of data\r\nHere is what I currently have:\r\n```\r\npublic void SaveFragmentData(ObjectId recordingId, string fragmentUrl, byte[] data)\r\n{\r\n\tvar recording = _db.Recordings.Single(r => r.Id == recordingId);\r\n\tvar fragment = recording.VideoFragments.Single(f=> f.Url == fragmentUrl);\r\n\tfragment.Data = data;\r\n\t_db.Recordings.Update(recording);\r\n\t_db.SaveChanges();\r\n}\r\n```\r\n\r\nI add get the recording, update the specific fragment of the recording then save it.\r\n\r\nI was hoping there might be a way to just get the fragment and update it individually.\r\n\r\nHere is a copy of my document:\r\n```\r\n{\r\n  \"_id\": \"5b5099d4139c5907ccddeac3\",\r\n  \"VideoFragments\": [\r\n    {\r\n      \"Url\": \"http://video-edge-85675c.syd01.abs.hls.ttvnw.net/v1/segment/CqEDdEsv7E8bCOEbkLIhBFQSmJ8XZv2-_1G....ts\",\r\n      \"Data\": \"<Binary Data>\"\r\n    },\r\n    {\r\n      \"Url\": \"http://video-edge-85675c.syd01.abs.hls.ttvnw.net/v1/segment/CqED-2SjHzRiHw4Vx9aIaGm8YrO2IVICuhK....ts\",\r\n      \"Data\": \"<Binary Data>\"\r\n    },\r\n    {\r\n      \"Url\": \"http://video-edge-85675c.syd01.abs.hls.ttvnw.net/v1/segment/CqEDj_wly9Rd0ZviOtA70UkzqGJHAE8jgZA....ts\",\r\n      \"Data\": null\r\n    },\r\n    {\r\n      \"Url\": \"http://video-edge-85675c.syd01.abs.hls.ttvnw.net/v1/segment/CqED5gZajJanx0rSVEt7tWTcr0s_hPBbMML....ts\",\r\n      \"Data\": null\r\n    },\r\n    {\r\n      \"Url\": \"http://video-edge-85675c.syd01.abs.hls.ttvnw.net/v1/segment/CqED4FZm9CfX5NVYVSYGhwbCpzW4nOTObmP....ts\",\r\n      \"Data\": \"<Binary Data>\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nCould you help me out?\r\n\r\nPs thanks for creating a provider like this, its super helpful to try out."},"comment":{"url":"https://api.github.com/repos/BlueshiftSoftware/EntityFrameworkCore/issues/comments/448736896","html_url":"https://github.com/BlueshiftSoftware/EntityFrameworkCore/issues/23#issuecomment-448736896","issue_url":"https://api.github.com/repos/BlueshiftSoftware/EntityFrameworkCore/issues/23","id":448736896,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODczNjg5Ng==","user":{"login":"crhairr","id":18196198,"node_id":"MDQ6VXNlcjE4MTk2MTk4","avatar_url":"https://avatars1.githubusercontent.com/u/18196198?v=4","gravatar_id":"","url":"https://api.github.com/users/crhairr","html_url":"https://github.com/crhairr","followers_url":"https://api.github.com/users/crhairr/followers","following_url":"https://api.github.com/users/crhairr/following{/other_user}","gists_url":"https://api.github.com/users/crhairr/gists{/gist_id}","starred_url":"https://api.github.com/users/crhairr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhairr/subscriptions","organizations_url":"https://api.github.com/users/crhairr/orgs","repos_url":"https://api.github.com/users/crhairr/repos","events_url":"https://api.github.com/users/crhairr/events{/privacy}","received_events_url":"https://api.github.com/users/crhairr/received_events","type":"User","site_admin":false},"created_at":"2018-12-19T20:42:24Z","updated_at":"2018-12-19T20:42:24Z","author_association":"MEMBER","body":"The work for this is being done as part of the fix for #33."}}
{"actor":{"display_login":"crhairr"}}