예제 #1
0
        public void Insert(InsertDummyServiceDto dto)
        {
            DummyService dummyService = new DummyService(dto.Request, dto.Response);
            string       jsonDetails  = _jsonSerializer.Serialize(dummyService);
            Service      service      = new Service(dto.Name, ServiceType.DUMMY, jsonDetails);

            _serviceRepository.Insert(service);
        }
        public ActionResult Create(IFormCollection collection)
        {
            try
            {
                InsertDummyServiceDto dto = new InsertDummyServiceDto();
                dto.Name     = collection["Name"];
                dto.Request  = collection["Request"];
                dto.Response = collection["Response"];

                _dummyServiceManager.Insert(dto);

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