Exemple #1
0
        public JsonResult ListJson()
        {
            SchoolsServices mongo   = new SchoolsServices("school", "school", "mongodb://localhost:27017/");
            var             schools = mongo.getAll();

            return(Json(schools));
        }
Exemple #2
0
        public IActionResult List()
        {
            SchoolsServices mongo   = new SchoolsServices("school", "school", "mongodb://localhost:27017/");
            var             schools = mongo.getAll();

            return(View("List", schools));
        }
Exemple #3
0
 public IActionResult Create(SchoolModel school)
 {
     if (school != null)
     {
         SchoolsServices mongo = new SchoolsServices("school", "school", "mongodb://localhost:27017/");
         mongo.create(school);
     }
     return(View());
 }