I have a table in mySql and it's contains 10 columns.I am implementing Get Api to fetch the data based on filter in query prams.
For Example :-
Select Data From myTable where id=2 AND eId=6 or Select Data From myTable where id=2 AND rlNumber=6 AND version=8 etc.
I have following approaches:-
- Pass the where condition from Business Layer but in this case i am exposing DL info in BL.
- using reflection (i will generate the Where condition based on pass parameters). We shpuld avoid reflection.
- Create a Enum like FilterType and create a dictionary. key will be Enum and value will be where condition.
any better approach ?
Aucun commentaire:
Enregistrer un commentaire