title: Problem filtering GET query by id in asp.net core. Getting the correct amount of rows but all are exactly the same
body: <p>I'm using the following Query in Postman https://localhost:44300/api/ViewEvents?Id=Bob. Instead off returning 4 different rows containing the ID Bob, it returns 4 of the exact same rows. Any help would be appreciated.</p>
  <p>API Controller</p>
  <pre><code>// GET: api/ViewEvents
         [HttpGet]
         public async Task&lt;ActionResult&lt;IEnumerable&lt;ViewEvents&gt;&gt;&gt; GetViewEvents(string id)
         {
  
             if(id == null)
             {
                 return await _context.ViewEvents.ToListAsync();
             }
             else
             {
                 
                 var viewEvents = _context.ViewEvents.Where(i =&gt; i.Id==(id)).ToList();
                 if (viewEvents.Count &lt; 1)
                 {
                     return NotFound();
                 }
                 
                 return viewEvents;
             }
         }
  </code></pre>
  <p>Database view returns correct results.</p>
  <pre><code>CREATE 
      ALGORITHM = UNDEFINED 
      DEFINER = `tim_azure`@`%` 
      SQL SECURITY DEFINER
  VIEW `view_events` AS
      SELECT 
          `e`.`CreatedUserID` AS `id`,
          `e`.`ID` AS `eventid`,
          `e`.`Event` AS `event`
      FROM
          `tblevent` `e`
  </code></pre>
  <p>The below image contains database restults.
  <a href="https://i.stack.imgur.com/3HLhH.png" rel="nofollow noreferrer">DataBase Results</a></p>