title: Get all rows using lambda expression Entity Framework
body: <p>I am using below lambda expression to get users list:</p>
  
  <pre><code>var query = UserManager.Users
                 .Include(u =&gt; u.Roles)
                 .WhereIf(input.Role.HasValue, u =&gt; u.Roles.Any(r =&gt; r.RoleId == input.Role.Value))
                 .WhereIf(
                     !input.Filter.IsNullOrWhiteSpace(),
                     u =&gt;
                         u.Name.Contains(input.Filter) ||
                         u.Surname.Contains(input.Filter) ||
                         u.UserName.Contains(input.Filter) ||
                         u.EmailAddress.Contains(input.Filter)
                 ).Select(store =&gt; new UserListDto { Id = store.Id, UserName = store.UserName + ' ' + store.Surname });
  
  var userListDtos = query.MapTo&lt;List&lt;UserListDto&gt;&gt;();
  </code></pre>
  
  <p>It's returning the desired result. Means admin user and its sub users list.</p>
  
  <p>But now I want all users list for super admin. I tried below but its giving only logged in user data (only 1 row).</p>
  
  <pre><code>var query = UserManager.Users.ToList();
  </code></pre>