public IActionResult Post(Role role) { try { _roleRepository.Insert(role); _roleRepository.Save(); return(Ok(true)); } catch (Exception ex) { Console.WriteLine(ex.Message); return(BadRequest()); } }
public UserViewModel Register(User user) { User resultantUser = _context.Insert(user); _context.Save(); return(new UserViewModel { Id = resultantUser.Id, Email = resultantUser.Email, Fullname = resultantUser.Fullname }); }