DefinitionCQSR is an architectural pattern which states that while designing the data access layer in a project, it can be split into two separate units of codebase. Those two units of codebase are:
So this is called command query separation. In a simpler manner, it is a separation of code which reads data from a database from code which changes the state of data in a database. Thus the responsibility of reading data from a database and writing data to the database can be separated.Benefits
These are two ways you can make this happen