Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-4818

.NET DayOfWeek does not work as a LINQ parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.9
    • None
    • platforms

    Description

      IGNITE-4359 added support for DateTime.DayOfWeek, but it can't be used in Where clause:

      var res = persons.AsCacheQueryable().Where(x => x.Value.BirthDay.DayOfWeek == DayOfWeek.Monday);
      

      This fails because DayOfWeek.Monday is written as a serializable enum.

      Workaround is to cast to an int:

      var res = persons.AsCacheQueryable().Where(x => (int)x.Value.BirthDay.DayOfWeek == (int)DayOfWeek.Monday);
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ptupitsyn Pavel Tupitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: