InternalCreate method

Future<void> InternalCreate(
  1. FolderId? parentFolderId,
  2. MessageDisposition? messageDisposition,
  3. SendInvitationsMode? sendInvitationsMode
)
Create item. The parent folder id. The message disposition. The send invitations mode.

Implementation

Future<void> InternalCreate(
    FolderId? parentFolderId,
    MessageDisposition? messageDisposition,
    SendInvitationsMode? sendInvitationsMode) async {
  this.ThrowIfThisIsNotNew();
  this.ThrowIfThisIsAttachment();

  if (this.IsNew || this.IsDirty) {
    await this.Service.CreateItem(
        this,
        parentFolderId,
        messageDisposition,
        sendInvitationsMode != null
            ? sendInvitationsMode
            : this.DefaultSendInvitationsMode);

    await this.Attachments.Save();
  }
}