How can I reduce the code redundancy in the code below? I am trying to build a query on basis of number of dynamic attachments uploaded. The user can add upto 5 attachments in total. The program needs to check the query on the basis of the number of input attachments and build a query. The sample code is shown below:How can I reduce the code redundancy in the cod