public ActionResult Create(School school)
        {
            if (ModelState.IsValid)
            {
                _schoolManager.Insert(school);
                return(RedirectToAction("Index"));
            }

            return(View(school));
        }
Exemplo n.º 2
0
        public dynamic AddShcool([FromBody] SchoolViewModel model)
        {
            var cm = new SchoolManager();

            model.Id = Guid.NewGuid().ToString();
            try
            {
                cm.Insert(model);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(Ok());
        }