public async Task <Response> Register([FromBody] RegistrationViewModel userModel)
        {
            var user = _mapper.Map <User>(userModel);

            await _userOperations.CreateAsync(user, userModel.Password);

            return(new Response
            {
                Status = ResponseStatus.Ok
            });
        }
Example #2
0
        public async Task Handle(AddUserIntegrationEvent @event)
        {
            var user = new User
            {
                UserName  = @event.Username,
                LastName  = @event.LastName,
                FirstName = @event.FirstName
            };

            await _userOperations.CreateAsync(user, @event.Password);
        }
        public async Task <Response> Register([FromBody] RegistrationViewModel userModel)
        {
            var user = new User
            {
                FirstName = userModel.FirstName,
                LastName  = userModel.LastName,
                Username  = userModel.Username
            };
            await _userOperations.CreateAsync(user, userModel.Password);

            return(new Response
            {
                Status = ResponseStatus.Ok
            });
        }
Example #4
0
 /// <summary>
 /// Create a new user.  (see
 /// http://msdn.microsoft.com/en-us/library/azure/dn130117.aspx for
 /// more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Graph.RBAC.IUserOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters to create a user.
 /// </param>
 /// <returns>
 /// Server response for Get user information API call
 /// </returns>
 public static Task <UserGetResult> CreateAsync(this IUserOperations operations, UserCreateParameters parameters)
 {
     return(operations.CreateAsync(parameters, CancellationToken.None));
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// </param>
 public static User Create(this IUserOperations operations, UserCreateModel body = default(UserCreateModel))
 {
     return(operations.CreateAsync(body).GetAwaiter().GetResult());
 }