public ActionResult <List <Student> > Get()
 {
     try
     {
         return(_studentsService.Get());
     }
     catch (System.Exception)
     {
         return(Problem(statusCode: 500));
     }
 }
Example #2
0
        public void Get_SearchByStudentName_StudentFound()
        {
            var studentName = "Charles";
            var students    = _subject.Get(SearchBy.Name, studentName, null, ' ');

            var expectedStudent = new Student("Charles", 4, 'M', "Elementary", new DateTime(2015, 01, 15, 10, 59, 34));
            var actualStudent   = students.First();

            Assert.Equal(expectedStudent, actualStudent);
        }
Example #3
0
 public ActionResult <IEnumerable <Student> > Get()
 {
     try
     {
         return(Ok(_ss.Get()));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
        // GET: Student/Edit/5
        public ActionResult Edit(int id)
        {
            var model = _studentsService.Get(id);

            return(View(model));
        }
Example #5
0
 public ActionResult <List <Students> > Get() =>
 _studentsService.Get();
 public Student Get(int id)
 {
     return(_service.Get(id));
 }