authUser method

Future<void> authUser(
  1. DatabaseSession session,
  2. MicrosoftAccount microsoftAccount,
  3. AuthUser authUser, {
  4. Transaction? transaction,
})

Creates a relation between the given MicrosoftAccount and AuthUser by setting the MicrosoftAccount's foreign key authUserId to refer to the AuthUser.

Implementation

Future<void> authUser(
  _i1.DatabaseSession session,
  MicrosoftAccount microsoftAccount,
  _i2.AuthUser authUser, {
  _i1.Transaction? transaction,
}) async {
  if (microsoftAccount.id == null) {
    throw ArgumentError.notNull('microsoftAccount.id');
  }
  if (authUser.id == null) {
    throw ArgumentError.notNull('authUser.id');
  }

  var $microsoftAccount = microsoftAccount.copyWith(authUserId: authUser.id);
  await session.db.updateRow<MicrosoftAccount>(
    $microsoftAccount,
    columns: [MicrosoftAccount.t.authUserId],
    transaction: transaction,
  );
}