public async Task <IHttpActionResult> Restore([FromBody] Office365UserRestoreViewModel model) { var office365UserRestore = Office365ServiceConstants.QueueManageSubscriptionsAndLicences; await _messageBroker.GetSendEndpoint(office365UserRestore) .Send <IManageSubscriptionsAndLicencesCommand>(model.ToManageSubscriptionsAndLicencesCommand()); return(Ok()); }
public static dynamic ToManageSubscriptionsAndLicencesCommand(this Office365UserRestoreViewModel viewModel) { return(new { viewModel.CompanyId, Users = new List <Office365UserViewModel> { new Office365UserViewModel { UserPrincipalName = viewModel.UserPrincipalName } }, MessageType = ManageSubsctiptionAndLicenceCommandType.RestoreUser }); }