public override async Task <ProjectContact> FindByPK(IPrimaryKey pk) { SqlCommandType = Constants.DBCommandType.SQL; CMDText = FINDBYPK_STMT; MapToObject = new ProjectContactMapToObject(logger); return(await base.FindByPK(pk)); }
public override async Task <ICollection <ProjectContact> > FindAll() { SqlCommandType = Constants.DBCommandType.SQL; CMDText = FINDALL_STMT; CMDText += ORDERBY_STMT + OrderBy; MapToObject = new ProjectContactMapToObject(logger); return(await base.FindAll()); }
public async Task <IPager <ProjectContact> > FindAll(IPager <ProjectContact> pager) { string storedProcedure = String.Empty; MapToObject = new ProjectContactMapToObject(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); }