© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
43 replies
oe

✅ Client needs filtering logic - what's the best way to implement?

I have two classes like so:
 public class VirtualStore
    {
        public string StoreName { get; set; }

        public List<VirtualProduct> Products { get; set; } = new();
    }
 public class VirtualStore
    {
        public string StoreName { get; set; }

        public List<VirtualProduct> Products { get; set; } = new();
    }

  public class VirtualProduct
    {
        public string Image { get; set; }
        public string StockNumber { get; set; }
        public string Description { get; set; }
        public string URL { get; set; }
        public string Category { get; set; }
        public string Price { get; set; }
        public string Currency { get; set; }
    }
  public class VirtualProduct
    {
        public string Image { get; set; }
        public string StockNumber { get; set; }
        public string Description { get; set; }
        public string URL { get; set; }
        public string Category { get; set; }
        public string Price { get; set; }
        public string Currency { get; set; }
    }

After my program runs, the List<VirtualProduct> Products variable is filled with objects and a JSON of it is returned to the client.

I want my client who knows nothing about coding to be able to filter products by writing in some language or query what objects he wants to keep in that list, based on certain conditions, like:

"CONTAINS toy", "EQUALS Best Toy In America", "NOT {{StoreName}}"

Should I implement this logic on my own, or use some sort of existing query language that C# can interpret / solution for this?

Thanks!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

What's the best way to implement charts in WPF
C#CC# / help
2y ago
What's the best way to keep a `BackgroundService` alive?
C#CC# / help
4y ago
❔ What's the best way to test a URL that's it's valid?
C#CC# / help
3y ago
Best way to implement a regex based lexer [Answered]
C#CC# / help
4y ago