Exemplo n.º 1
0
        public async Task <IActionResult> Create(ButtonDto create)
        {
            if (_btnService.GetById(create.ID) != null)
            {
                return(BadRequest("Button ID already exists!"));
            }
            //create.CreatedDate = DateTime.Now;
            if (await _btnService.Add(create))
            {
                return(NoContent());
            }

            throw new Exception("Creating the Button failed on save");
        }