title: How to search by date in .NET Core Razor pages?
body: <p>I first tried with normal sorting and filtering method to search by date but it did not work with datetime datatype and works only with string datatype. It would be great if anyone could hep me figure out how to make this work. Also, I want the same solution to be used for .NET MVC 5. For that, I tried <a href="https://stackoverflow.com/questions/39785736/search-date-from-the-detail-asp-net-mvc-5">Search date from the detail asp.Net mvc 5</a>, but for some reason, it is not working for me. </p>
  
  <p>Thank you in advance.</p>
  
  <p>Here is the code: </p>
  
  <pre><code>        //Search by BirthDate
          if (searchStringbyBirthDate != null)
          {
              pageIndex = 1;
          }
          else
          {
              searchStringbyBirthDate = currentFilterBirthDate;
          }
          CurrentFilterBirthDate = searchStringbyBirthDate;
  
          //Filtering by BirthDate:not working
          if (!string.IsNullOrEmpty(searchStringbyBirthDate))
          {
           personData=personData.Where(b=&gt;b.BirthDate.Equals(searchStringbyBirthDate));
          }
  </code></pre>
  
  <p>I have it as string here and I know that is wrong but I am unsure how to give datetime here.</p>