public async Task <ActionResult <User> > AddUserAsync([FromBody] User user)
        {
            try{
                User user1 = await userService.AddUserAsync(user);

                return(Ok(user1));
            }catch (Exception e) {
                Console.WriteLine(e.Message);
                StatusCode(409, e.Message);
            }
            return(null);
        }
Exemple #2
0
        public async Task <IActionResult> AddUserAsync([FromBody] User user)
        {
            await _user.AddUserAsync(user);

            return(Ok("EmployeeData gets created"));
        }