Exemplo n.º 1
0
        public async Task <ActionResult> Add(StudyFieldDegreeViewModel studyFieldDegreeModel)
        {
            var studyField = new DomainClasses.StudyFieldDegree
            {
                Id   = studyFieldDegreeModel.Id,
                Name = studyFieldDegreeModel.Name
            };

            _studyFieldDegreeService.Add(studyField);

            await _dbContext.SaveChangesAsync();

            return(Json(studyField.Id));
        }
Exemplo n.º 2
0
        public async Task<ActionResult> Add(StudyFieldDegreeViewModel studyFieldDegreeModel)
        {
            var studyField = new DomainClasses.StudyFieldDegree
            {
                Id = studyFieldDegreeModel.Id,
                Name = studyFieldDegreeModel.Name
            };

            _studyFieldDegreeService.Add(studyField);

            await _dbContext.SaveChangesAsync();

            return Json(studyField.Id);
        }