public IActionResult CurrencyMaster(string msg, int?page, int ID) { // For Using Paging we installed X.PagedList.Mvc.Core package. // For more details see link : https://github.com/dncuug/X.PagedList // Using X.PagedList; Namespace is need to call for the usage. int pageNumber = page ?? 1; ViewBag.MsgShow = msg; CurrencyVM model = new CurrencyVM(); model.CurrencyList = _CurrencyService.AllCurrenciesList().ToPagedList(pageNumber, PageSize); if (ID != 0) { var data = _CurrencyService.GetCurrencyByID(ID); Currency Curr = new Currency { ID = data.ID, Symbol = data.Symbol }; model.Currency = Curr; } return(View(model)); }