示例#1
0
 public IActionResult Post(Role role)
 {
     try
     {
         _roleRepository.Insert(role);
         _roleRepository.Save();
         return(Ok(true));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         return(BadRequest());
     }
 }
示例#2
0
        public UserViewModel Register(User user)
        {
            User resultantUser = _context.Insert(user);

            _context.Save();
            return(new UserViewModel
            {
                Id = resultantUser.Id,
                Email = resultantUser.Email,
                Fullname = resultantUser.Fullname
            });
        }