예제 #1
0
        public async Task <ActionResult> Edit(StudyFieldDegreeViewModel studyFieldDegreeModel)
        {
            _studyFieldDegreeService.Edit(new DomainClasses.StudyFieldDegree
            {
                Id   = studyFieldDegreeModel.Id,
                Name = studyFieldDegreeModel.Name
            });

            await _dbContext.SaveChangesAsync();

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }
예제 #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));
        }