コード例 #1
0
        public async Task <IPager <City> > FindAll(IPager <City> pager)
        {
            string storedProcedure = String.Empty;

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

            storedProcedure = Settings.Database.StoredProcedures.FirstOrDefault(p => p == FINDALL_PAGEDPROC);
            if (storedProcedure == null)
            {
                SqlCommandType = Constants.DBCommandType.SQL;
                CMDText        = String.Format(FINDALLPAGER_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 override async Task <City> FindByPK(IPrimaryKey pk)
 {
     SqlCommandType = Constants.DBCommandType.SQL;
     CMDText        = FINDBYPK_STMT;
     MapToObject    = new CityMapToObject(logger);
     return(await base.FindByPK(pk));
 }
コード例 #3
0
 public override async Task <ICollection <City> > FindAll()
 {
     CMDText     = FINDALL_STMT;
     CMDText    += ORDERBY_STMT + OrderBy;
     MapToObject = new CityMapToObject(logger);
     return(await base.FindAll());
 }
コード例 #4
0
 public override async Task <ICollection <City> > FindAll()
 {
     SqlCommandType = Constants.DBCommandType.SQL;
     CMDText        = FINDALL_STMT;
     CMDText       += ORDERBY_STMT + OrderBy;
     MapToObject    = new CityMapToObject(logger);
     return(await base.FindAll());
 }
コード例 #5
0
 public IPager <City> FindAll(IPager <City> pager)
 {
     SqlCommandType = Constants.DBCommandType.SQL;
     CMDText        = String.Format(FINDALLPAGER_STMT, pager.PageSize, pager.PageSize * pager.PageNbr);
     //CMDText += ORDERBY_STMT + OrderBy;
     MapToObject    = new CityMapToObject(logger);
     pager.Entities = base.FindAll();
     CMDText        = FINDALLCOUNT_STMT;
     pager.RowCount = base.FindAllCount();
     return(pager);
 }
コード例 #6
0
 public override async Task <City> FindByPK(IPrimaryKey pk)
 {
     CMDText     = FINDBYPK_STMT;
     MapToObject = new CityMapToObject(logger);
     return(await base.FindByPK(pk));
 }