MVC Architecture introduction-query function development and mvc Architecture query Development
- Select and from statements
Note:
Select and from can be left unspecified. By default:
Select to obtain all fields in the ing table;
From obtains the table name of the object ing table;
If select is set, frorm must be set, but only from can be set without select
Set parameters by @ number, for example:
Define naming Parameters
- To implement an in statement, you can only use named parameters, for example:
- You can also use Append to build SQL statements more flexibly.
Paging query:
Call the GetPagingEntities method in the derived Repository to obtain the paging data and return the encapsulated paging set by PagingDataSet <T>.
For example:
Non-Paging query:
Call the GetTopEntities method in the derived Repository to obtain the first N data sets and return the IEnumerable <T> type data set.
For example:
Instance product based on asp.net mvc 5.0 framework, source code: http://www.jinhusns.com/Products/Download