Example #1
0
        public async Task <IActionResult> Put(SaveEnvironmentRequestDTO environmentDTO)
        {
            DB.Models.Environment environment = _mapper.Map <DB.Models.Environment>(environmentDTO);

            var res = _service.Edit(environment);

            if (res.IsSuccess)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest(res.Errors));
            }
        }
Example #2
0
        public IActionResult Add(SaveEnvironmentRequestDTO environmentDTO)
        {
            DB.Models.Environment environment = _mapper.Map <DB.Models.Environment>(environmentDTO);

            var res = _service.Add(environment);

            if (res.IsSuccess)
            {
                return(Ok(res.IsSuccess));
            }
            else
            {
                return(BadRequest(res.Errors));
            }
        }