public ActionResult <List <Student> > Get() { try { return(_studentsService.Get()); } catch (System.Exception) { return(Problem(statusCode: 500)); } }
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); }
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)); }
public ActionResult <List <Students> > Get() => _studentsService.Get();
public Student Get(int id) { return(_service.Get(id)); }