title: How to get property value from dynamic model in MVC razor c#
body: <p>View:</p>
  
  <pre><code>@model  dynamic
  
  &lt;div class="btn-group"&gt;
      &lt;a class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="#"&gt;Select a Country &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
      &lt;ul class="dropdown-menu"&gt;
         @foreach (dynamic m in Model)
         {
            &lt;li&gt;&lt;a href="#"&gt;"@m.EmployeeName"&lt;/a&gt;&lt;/li&gt;
         }
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Controller :</p>
  
  <pre><code>public ActionResult Index()
          {
               var Employees = Connections.SaleBranch.SqlConn.Query("SELECT EmployeeName,EmployeeID FROM dbo.udft_Employee(@RunDate) WHERE OfficerEmployeeID=@OfficerEmployeeID",
              new { OfficerEmployeeID = 78273, RunDate = DateTime.Now.GetPersianDate() },
              commandType: CommandType.Text).ToList();
              var EmployeesList = Employees.Select(x =&gt; new { EmployeeName = x.EmployeeName, EmployeeID = x.EmployeeID }).ToList();
  
              return View("Point/Index", EmployeesList);
          }
  </code></pre>
  
  <p>The object <code>m</code> shows 2 properties(EmployeeName,EmployeeID).</p>
  
  <p><a href="https://i.stack.imgur.com/poxVB.png" rel="nofollow"><img src="https://i.stack.imgur.com/poxVB.png" alt="enter image description here"></a></p>
  
  <p>But can't fetch <code>m.EmployeeName</code> value</p>
  
  <p><a href="https://i.stack.imgur.com/lJYPm.png" rel="nofollow"><img src="https://i.stack.imgur.com/lJYPm.png" alt="enter image description here"></a></p>