Write a custom .NET attribute to mark searchable columns of a HTML table and match them with their equivalent DB columns
Consider you have to implement the following requirement:
We have a MVC .NET web application and a view with a HTML table and multiple columns. We want to mark some of these columns as searchable, so that we can search their values when we use the search field.
We host our data in a relational database, we get the structure of the DB table as it is. We use Entity Framework and we need to “map” the DB columns to their equivalent UI columns, so that the search works correctly.
Here a simple mockup of our UI:Read the complete article