示例#1
0
        public async Task <IPager <City> > FindAllView(IPager <City> pager)
        {
            string storedProcedure = String.Empty;

            //CMDText += ORDERBY_STMT + OrderBy;
            MapToObject = new CityMapToObjectView(logger);

            storedProcedure = Settings.Database.StoredProcedures.FirstOrDefault(p => p == FINDALL_PAGEDVIEWPROC);
            if (storedProcedure == null)
            {
                SqlCommandType = Constants.DBCommandType.SQL;
                CMDText        = String.Format(FINDALLVIEWPAGER_STMT, pager.PageSize * pager.PageNbr, pager.PageSize);
                pager.Entities = await base.FindAll();
            }
            else
            {
                SqlCommandType = Constants.DBCommandType.SPROC;
                CMDText        = storedProcedure;
                pager.Entities = await base.FindAllPaged(pager.PageSize *pager.PageNbr, pager.PageSize);
            }

            CMDText        = FINDALLCOUNT_STMT;
            pager.RowCount = await base.FindAllCount();

            return(pager);
        }
示例#2
0
 public async Task <ICollection <City> > FindAllView()
 {
     CMDText = FINDALLVIEW_STMT;
     //CMDText += ORDERBY_STMT + OrderBy;
     MapToObject = new CityMapToObjectView(logger);
     return(await base.FindAll());
 }
示例#3
0
 public async Task <ICollection <City> > FindAllView()
 {
     SqlCommandType = Constants.DBCommandType.SQL;
     CMDText        = FINDALLVIEW_STMT;
     //CMDText += ORDERBY_STMT + OrderBy;
     MapToObject = new CityMapToObjectView(logger);
     return(await base.FindAll());
 }