Classes are structured as below. MVC asp.net page
Controller calls Application Service to get data and post data to database.
Domain Entity class which is used by unit of work to insert, update and read data from db.
My question is where do I call sql function
Unitofwork.sqlquery<decimal>("select fn_testfunction").FirstOrDefault
From application service do I need to have separate domain Service to perform all these sql call? Or Can I call sql function directly from application service and expose the function name there? I have read while Google that we need to use CQRS to call procs and function. I don't understand how to achieve that. Please suggest