hello friends i am following 3 layer architecture for my project i mean
presentation layer, business logic layer and finally database layer
my question is that i am making a search feature for my project where i need to send parameter through a method for search query which is to make on business logic layer
i am to send parameter from presentation layer by calling some method and those parameter will be used on business logic layer’s method to make appropriate query
it’s not sure sure how many parameters will be send every time i mean parameters are optional
so my question is that how should i send these optional parameter for getting exactly the require parameter on business logic layer.
What is the best way, i am programming in asp.net
If you use business entities, mark every properties by custom attribute with (mask = 1, 2, 4, 8…, required = true/false).
then you can use reflection to read all required properties and pass them to sp. if some not required parameters is null (use Nullable<>) don’t increment mask (mask &= propertyMask).
Use integer mask to partial update.
2) For select, use two masks (select, and where)