How should you handle parent and child entities in the repository pattern? <p>I'm working on making a image site and I'm wondering how I should structure the Create/Update methods in my Linq to Sql repository?</p> <p>I have a Photo entity that is structured like:</p> <pre><code>public class Image { public int ID { get; set; } public int OwnerId { get; set; } public string Url { get; set; } public IEnumerable&lt;Tag&gt; Tags { get; set; } } </code></pre> <p>I have the following tables: Images, Tags, ImageTag</p> <p>Now, I'm wondering when I call my CreateImage method in my ImageRepository, should I also be creating the Tags in the Tags table and the making the mappings in the ImageTag table?</p> <p>Likewise, when I call UpdateImage, should I be checking if the tags have changed, and if they have then deleting entries in the ImageTag table and adding in different ones (as well as possibly adding new Tags to the tags table)?</p> <p>Or should both of these use cases happen in a separate repository call? </p> <p>Basically, how is this parent/child, one-to-many relationship handled typically in a typical linq to sql repository?</p>