Esempio n. 1
0
        public IActionResult Create(MasterServices masterServices)
        {
            var createdMaster = new List <MasterServices>();

            try
            {
                ViewBag.Serviсes = new SelectList(_crudService.GetAll(), "Id", "NameOfService");
                createdMaster.Add(_masterServiceCrudService.Create(masterServices));
            }
            catch (ServiceOperationException exception)
            {
                ViewBag.Error = ErrorFactory.IdentifyExceptionByType(exception).Description;
                return(View(masterServices));
            }

            return(RedirectToAction("Get", new { masterId = masterServices.MasterId }));
        }