Пример #1
0
        public static List <T> Filter <T>(List <string> columnsAndValues) where T : DbEntity
        {
            var tableName = UtilAnnotationTableDb <T> .GetTableName();

            string queryFilter = FilterLikeBuilder.Build(columnsAndValues, "=", " LIKE ");

            return(SqlCommandSelectFilter <T> .Execute(tableName, queryFilter));
        }
Пример #2
0
        public static List <T> Filter <T>(string pageNumber, string totalPageNumber,
                                          List <string> columnsAndValues, List <string> sortingList) where T : DbEntity
        {
            var tableName = UtilAnnotationTableDb <T> .GetTableName();

            string queryFilter = FilterLikeBuilder.Build(columnsAndValues, "=", " LIKE ");

            string sorting = sortingList != null && sortingList.Count > 0
                ? string.Join(",", sortingList.ToArray())
                : "(SELECT NULL)";

            return(SqlCommandSelectPaginationSortingFilter <T> .Execute(tableName, pageNumber,
                                                                        totalPageNumber, sorting, queryFilter));
        }