public async Task <List <StateIndex> > GetIndex(Int64 ScreenId, Int64 UserId, Int64 RecordsPerPage, Int64 PageNo, Int64 TableId, Boolean LastPage) { CountryIndex result = new CountryIndex(); try { string csql = @" EXEC spGetPageData @pi_mScreenId , @pi_mUserId , @pi_RecordsPerPage , @pi_PageNo , @pi_mTableId , @pi_LastPage"; List <SqlParameter> sqlparam = new List <SqlParameter>() { new SqlParameter("@pi_mScreenId", ScreenId), new SqlParameter("@pi_mUserId", UserId), new SqlParameter("@pi_RecordsPerPage", RecordsPerPage), new SqlParameter("@pi_PageNo", PageNo), new SqlParameter("@pi_mTableId", TableId), new SqlParameter("@pi_LastPage", LastPage), }; return(await _Context.StateIndex.FromSql(csql, sqlparam.ToArray()).ToListAsync()); } catch (Exception ex) { throw ex; } }
public async Task <CountryIndex> GetEntry(Int64 id) { try { CountryIndex result = await _Context.CountryIndex.FromSql("Exec spmCountryEntry @pi_mCountryId", new SqlParameter("@pi_mCountryId", id)).SingleOrDefaultAsync(); return(result); } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> Get(Int64 id) { CountryIndex result = await _repo.GetEntry(id); return(Ok(result)); }