public override Contact FindByPK(IPrimaryKey pk)
 {
     SqlCommandType = Constants.DBCommandType.SQL;
     CMDText        = FINDBYPK_STMT;
     MapToObject    = new ContactMapToObject(logger);
     return(base.FindByPK(pk));
 }
예제 #2
0
        public async Task <IPager <Contact> > FindAll(IPager <Contact> pager)
        {
            string storedProcedure = String.Empty;

            //CMDText += ORDERBY_STMT + OrderBy;
            MapToObject = new ContactMapToObject(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);
        }
예제 #3
0
 public override async Task <ICollection <Contact> > FindAll()
 {
     CMDText     = FINDALL_STMT;
     CMDText    += ORDERBY_STMT + OrderBy;
     MapToObject = new ContactMapToObject(logger);
     return(await base.FindAll());
 }
 public override ICollection <Contact> FindAll()
 {
     SqlCommandType = Constants.DBCommandType.SQL;
     CMDText        = FINDALL_STMT;
     CMDText       += ORDERBY_STMT + OrderBy;
     MapToObject    = new ContactMapToObject(logger);
     return(base.FindAll());
 }
 public IPager <Contact> FindAll(IPager <Contact> pager)
 {
     SqlCommandType = Constants.DBCommandType.SQL;
     CMDText        = String.Format(FINDALLPAGER_STMT, pager.PageSize, pager.PageSize * pager.PageNbr);
     //CMDText += ORDERBY_STMT + OrderBy;
     MapToObject    = new ContactMapToObject(logger);
     pager.Entities = base.FindAll();
     CMDText        = FINDALLCOUNT_STMT;
     pager.RowCount = base.FindAllCount();
     return(pager);
 }
예제 #6
0
 public override async Task <Contact> FindByPK(IPrimaryKey pk)
 {
     CMDText     = FINDBYPK_STMT;
     MapToObject = new ContactMapToObject(logger);
     return(await base.FindByPK(pk));
 }