Beispiel #1
0
        public void Insert(InsertExposerDto dto)
        {
            Service servie  = _serviceRepository.Get(dto.ServiceId);
            Exposer exposer = new Exposer(dto.Name, dto.Path, servie);

            _exposerRepository.Insert(exposer);
        }
        public ActionResult Create(IFormCollection collection)
        {
            try
            {
                InsertExposerDto dto = new InsertExposerDto();
                dto.Name      = collection["Name"];
                dto.Path      = collection["Path"];
                dto.ServiceId = collection["ServiceId"];

                _exposerManager.Insert(dto);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }