public IEnumerable <sp_car_search_v2_Result> search(carModel value) { try { if (String.IsNullOrEmpty(value.user_id)) { throw new Exception("Unauthorized Access"); } var userId = JwtHelper.GetUserIdFromToken(value.user_id); if (String.IsNullOrEmpty(userId)) { throw new Exception("Unauthorized Access"); } StandardCanEntities context = new StandardCanEntities(); IEnumerable <sp_car_search_v2_Result> result = context.sp_car_search_v2(value.car_type_from, value.car_type_to, value.car_from, value.car_to).AsEnumerable(); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }