I'll use C# to design the model to be persisted
Let's suppose I have the following entity:
public class Episode { public int Id { get; set; } public string Title { get; set; } public string Image { get; set; } } This a very simple entity, which is easy to map to a relational model.
But, what about if I want my Episode entity to have one or more images?
How would I represent this?
I can, for example create this entity model:
public class Episode { public int Id { get; set; } public string Title { get; set; } public ICollection<string> Images { get; set; } } But this, does not assure I have at least one image in my collection.
Furthermore, how would I design the relational model for this entity? How can I represent an entity that has a "1 to many" relationship with a string?
Do I need to create an additional table just for storing these "strings"?
I would really appreciate any advice you may want to share, and the best approach to this problem