Esempio n. 1
0
        public async Task<ActionResult> Edit(AddUniversityViewModel universityModel)
        {
            _universityService.Edit(new DomainClasses.University
            {
                Id = universityModel.Id,
                Name = universityModel.Name
            });

            await _dbContext.SaveChangesAsync();

            return new HttpStatusCodeResult(HttpStatusCode.OK);
        }
Esempio n. 2
0
        public async Task<ActionResult> Add(AddUniversityViewModel universityModel)
        {
            var university = new DomainClasses.University
            {
                Name = universityModel.Name
            };

            _universityService.Add(university);

            await _dbContext.SaveChangesAsync();

            return Json(university.Id);
        }