Project exposes WebAPI to the external clients and they will embed multiple parameter values in query string and this query string data will be stored in DB.
Question My silly question is how I should pass query string values from WebAPI action to business layers.
I can think of two ways: 1. Passing complete Request object to business layer. 2. Convert query string parameters to a list or array and pass that list / array to business layer.
Do you consider passing Request is sort of overkilling or burdon on system. I m just thinking it might be a heavy object in term of size.
If I convert query string parameters am I doing something against development good practices or Microsoft recommendation ?
I highly appreciate your guidance.
System.Web.Httpin your business layer which you should try to avoid where possible.int, string, etc.) and it's up to you whether to pass them into BL methods or to assemble DTO objects and pass those in. Generally, the latter makes the most sense, but like all things in software development, it depends.