public IEnumerable <UserViewModel> Get() { var list = _iBOUsers.GetUsers(); List <UserViewModel> objList = new List <UserViewModel>(); foreach (var item in list) { UserViewModel uvm = new UserViewModel(); uvm.user_age = item.user_age; uvm.user_id = item.user_id; uvm.user_name = item.user_name; uvm.user_phone = item.user_phone; uvm.user_pwd = item.user_pwd; uvm.user_email = item.user_email; uvm.cityName = item.city_name; objList.Add(uvm); } return(objList); }
public IActionResult UsersList() { var list = _IBOUsers.GetUsers(); List <UserViewModel> objList = new List <UserViewModel>(); foreach (var item in list) { UserViewModel uvm = new UserViewModel(); uvm.user_age = item.user_age; uvm.user_id = item.user_id; uvm.user_name = item.user_name; uvm.user_phone = item.user_phone; uvm.user_pwd = item.user_pwd; uvm.user_email = item.user_email; uvm.cityName = item.city_name; objList.Add(uvm); } return(View(objList)); }
public JsonResult GetUsersLists() { //var sa = new JsonSerializerSettings(); var list = _IBOUsers.GetUsers(); List <UserViewModel> objList = new List <UserViewModel>(); foreach (var item in list) { UserViewModel uvm = new UserViewModel(); uvm.user_age = item.user_age; uvm.user_id = item.user_id; uvm.user_name = item.user_name; uvm.user_phone = item.user_phone; uvm.user_pwd = item.user_pwd; uvm.user_email = item.user_email; uvm.ImagePathUvm = item.user_ImagePath; uvm.cityName = item.city_name; objList.Add(uvm); } var obj = objList; return(Json(obj, new JsonSerializerSettings())); }