public async Task<ActionResult> Create(SpecializationViewModel model)
        {
            if (ModelState.IsValid)
            {
                var specialization = new Specialization
                {
                    Code = model.Code,
                    DisplayName = model.DisplayName
                };

                await _specializationService.CreateAsync(specialization);
                return RedirectToAction("Index");
            }

            return View(model);
        }
Exemple #2
0
 public async Task<Specialization> CreateAsync(Specialization specialization)
 {
     _specializationRepository.Insert(specialization);
     await _unitOfWork.SaveChangesAsync();
     return specialization;
 }