Skip to content

[QUESTION] DateTime Searching problem #61

@vukasinpetrovic

Description

@vukasinpetrovic

Describe the question
I implemented SearchableDateTime field on many tables, but it works only on one and I cannot figure out why. In those on which it does not work, sorting works but searching does not in a way that whatever I type in searchbox no results match.

This is a model that works:

public class ApplicationUserDTO
    {
        [Sortable]
        [SearchableString]
        public string Id { get; set; }
        
        [Sortable]
        [SearchableString]
        public string UserName { get; set; }
        
        [Sortable]
        [SearchableString]
        public string Email { get; set; }
        
        [Sortable(EntityProperty = "Profile.Location.Address")]
        [SearchableString(EntityProperty = "Profile.Location.Address")]
        public string Location { get; set; }
        
        [Sortable(EntityProperty = "Profile.Gender")]
        [SearchableEnum(typeof(Gender), EntityProperty = "Profile.Gender")]
        public string Gender { get; set; }
        
        [Sortable(EntityProperty = "Profile.DateOfBirth")]
        [SearchableDateTime(EntityProperty = "Profile.DateOfBirth")]
        public DateTime? DateOfBirth { get; set; }
        
        public bool Active { get; set; }
    }

image
image

This is a model that does not work:

    public class PostReportDTO
    {
        [Sortable]
        [SearchableLong]
        public long Id { get; set; }
        
        [Sortable]
        [SearchableDateTime]
        public DateTime DateTime { get; set; }
        
        [Sortable(EntityProperty = "ReportedBy.UserName")]
        [SearchableString(EntityProperty = "ReportedBy.UserName")]
        public string ReportedBy { get; set; }

        public PostDTO Post { get; set; }
        
        [Sortable]
        [SearchableString]
        public string Explanation { get; set; }
        
        public bool Resolved { get; set; }
    }

image

image
image

Desktop (please complete the following information):
OS: [e.g. iOS] MacOS Big Sur
Browser [e.g. chrome, safari] Chrome
Version [e.g. 22] 91
.NET Core 3.1

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions