...
Interface
IAccountManager
Syntax
_accountManagerAccountManager.Register( UserRegistrationContext registrationContext )
Returns
MTOA.DomainObjects.User
Task<User>
API
[POST] /api/v1/account/register
Sample request body
Code Block |
---|
{ "User": { "FirstName": "string", "LastName": "string", "Email": "string", "DisplayPhoneNumber": "string" }, "AuthenticationContext": { "Type": "GCKey", "GCKey": { "MBUN": "string", "Issuer": "string" }, "WindowsUserName": "string" } } |
Returns
UserDTO
Example
Code Block | ||
---|---|---|
| ||
using MTOA.BLL.Interfaces; var registrationContext = new UserRegistrationContext() { AuthenticationContext = new AuthenticationContext() { GCKey = "xyz", Type = AuthenticationType.GCKey }, User = new BareUser() { Email = "john.doe@tc.gc.ca", FirstName = "John", LastName = "Done" } }; User user = await _accountManager.Register( registrationContext ); if (user != null) { _logger.Info( $"User {user.FirstName} {user.LastName} was added successfully."); } else { _logger.Error($"Failed to register user."); } |
...