コード例 #1
0
        public IEnumerable <object> Get()
        {
            List <object> _list = new List <object>();

            var result = _dBRepository.GetAll();

            foreach (var item in result)
            {
                _list.Add(item.ToJson());
            }

            return(_list);
        }
コード例 #2
0
 public ResponseViewModel GetAllUser()
 {
     ResponseViewModel response = new ResponseViewModel();
     try
     {
         var result = _userRepository.GetAll().AsQueryable().ToList();
         if (result != null)
         {
             response.Message = Constants.Retreived;
             response.ResponseData = result;
             response.Status = (int)Numbers.One;                    
         }              
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return response;
 }
コード例 #3
0
        public IActionResult Index()
        {
            var viewModel = _studentRepository.GetAll();

            return(View(viewModel));
        }