Hi @Yusuf, thank you for using Blazor, we have official samples here, and hope it could help.
In your scenario, you want to have a best practice for where to write the code for these operations
. This is similar to what is the best practice for a structure
which is hard to define without detailed requirement. For example, we create a tool class to covert string to specific format, we'd better to create a Tools folder and create a specific file which containing this service in it, and we could inject this service wherever we want to use this method. But if we just want to write a demo, or this method will only be used in a specific component, then we don't need to create so many files and folders and add so many configurations, we just need write a method in the component where we want to use it.
The same for the search logic and other queries. We could create corresponding models, search logic and other methods in the component directly, or creating separate service files for them, it depends on the requirement. By the way, the best practice for placing the codes can be adjusted during the lifecycle of the application. One of the methods might be more and more complex in future, then we might divide the method into several methods to make it easier to maintain, and one day these methods might even be placed in several services one day. We can't predict for a very long time. But if it's just in the beginning or if we just need a simple sample, I'm afraid placing all the related methods together in a component might be the best option. We can certainly put the query methods in a separate service in advance when we already know that we would have several methods for a simple query in a near future.