title: How to store multiple values in a single column in a database?
body: <p>I want to be able to store/display information about different gym branches in the database. I have the following information about each branch. </p>
  
  <ol>
  <li>Id </li>
  <li>Name  </li>
  <li>RoomNumber </li>
  <li>Capacity</li>
  <li>Address</li>
  </ol>
  
  <p>Each branch will have its unique address and each RoomNumber will have a different capacity and branch name. I have searched and tried different ways but I am unable to fix it. The below code shows what I have done. </p>
  
  <p>The Branch Model that will store a record of each branch.</p>
  
  <pre><code> public class Branch
   {
       public int Id { get; set; }
  
       [Required]
       [Display(Name = "Branch Name")]
       [StringLength(50)]
       public List&lt;BranchName&gt; BranchName { get; set; }
  
       [Required]
       public int RoomNumber { get; set; }
  
       [Required]
       [Range(5, 30)]
       public int Capacity { get; set; }
  
       [Required]
       [StringLength(50)]
       public string Address { get; set; }
  }
  </code></pre>
  
  <p>This is the BranchName model with RoomNumbers. </p>
  
  <pre><code> public class BranchName
   {
       public int Id { get; set; }
  
       [Required]
       public string Name { get; set; }
  
       [Required]
       public List&lt;int&gt; RoomNumbers { get; set; } 
   }
  </code></pre>
  
  <p>The below screen shot shows when run migration, BranchName model does not add the list of the rooms property.</p>
  
  <p><a href="https://i.stack.imgur.com/rWWXa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rWWXa.png" alt="enter image description here"></a></p>
  
  <p>Thank you </p>