Fixing an issue where DeleteAsync calls expect PK.
This commit is contained in:
@@ -83,7 +83,7 @@ public class AccountService : BaseDatabaseService, IAccountService
|
|||||||
}
|
}
|
||||||
|
|
||||||
await Connection.ExecuteAsync("UPDATE MailAccount SET MergedInboxId = NULL WHERE MergedInboxId = ?", mergedInboxId).ConfigureAwait(false);
|
await Connection.ExecuteAsync("UPDATE MailAccount SET MergedInboxId = NULL WHERE MergedInboxId = ?", mergedInboxId).ConfigureAwait(false);
|
||||||
await Connection.DeleteAsync<MergedInbox>(mergedInbox).ConfigureAwait(false);
|
await Connection.DeleteAsync<MergedInbox>(mergedInbox.Id).ConfigureAwait(false);
|
||||||
|
|
||||||
// Change the startup entity id if it was the merged inbox.
|
// Change the startup entity id if it was the merged inbox.
|
||||||
// Take the first account as startup account.
|
// Take the first account as startup account.
|
||||||
@@ -290,9 +290,9 @@ public class AccountService : BaseDatabaseService, IAccountService
|
|||||||
await Connection.Table<CustomServerInformation>().DeleteAsync(a => a.AccountId == account.Id);
|
await Connection.Table<CustomServerInformation>().DeleteAsync(a => a.AccountId == account.Id);
|
||||||
|
|
||||||
if (account.Preferences != null)
|
if (account.Preferences != null)
|
||||||
await Connection.DeleteAsync<MailAccountPreferences>(account.Preferences);
|
await Connection.DeleteAsync<MailAccountPreferences>(account.Preferences.Id);
|
||||||
|
|
||||||
await Connection.DeleteAsync<MailAccount>(account);
|
await Connection.DeleteAsync<MailAccount>(account.Id);
|
||||||
|
|
||||||
await _mimeFileService.DeleteUserMimeCacheAsync(account.Id).ConfigureAwait(false);
|
await _mimeFileService.DeleteUserMimeCacheAsync(account.Id).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class CalendarService : BaseDatabaseService, ICalendarService
|
|||||||
await Connection.ExecuteAsync(
|
await Connection.ExecuteAsync(
|
||||||
"DELETE FROM CalendarItem WHERE CalendarId = ? AND AccountId = ?",
|
"DELETE FROM CalendarItem WHERE CalendarId = ? AND AccountId = ?",
|
||||||
accountCalendar.Id, accountCalendar.AccountId);
|
accountCalendar.Id, accountCalendar.AccountId);
|
||||||
await Connection.DeleteAsync<AccountCalendar>(accountCalendar);
|
await Connection.DeleteAsync<AccountCalendar>(accountCalendar.Id);
|
||||||
|
|
||||||
WeakReferenceMessenger.Default.Send(new CalendarListDeleted(accountCalendar));
|
WeakReferenceMessenger.Default.Send(new CalendarListDeleted(accountCalendar));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class ContactService : BaseDatabaseService, IContactService
|
|||||||
|
|
||||||
if (contact != null && !contact.IsRootContact)
|
if (contact != null && !contact.IsRootContact)
|
||||||
{
|
{
|
||||||
await Connection.DeleteAsync<AccountContact>(contact).ConfigureAwait(false);
|
await Connection.DeleteAsync<AccountContact>(contact.Address).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ public class FolderService : BaseDatabaseService, IFolderService
|
|||||||
|
|
||||||
_logger.Debug("Deleting folder {FolderName}", folder.FolderName);
|
_logger.Debug("Deleting folder {FolderName}", folder.FolderName);
|
||||||
|
|
||||||
await Connection.DeleteAsync<MailItemFolder>(folder).ConfigureAwait(false);
|
await Connection.DeleteAsync<MailItemFolder>(folder.Id).ConfigureAwait(false);
|
||||||
|
|
||||||
// Delete all existing mails from this folder.
|
// Delete all existing mails from this folder.
|
||||||
await Connection.ExecuteAsync("DELETE FROM MailCopy WHERE FolderId = ?", folder.Id);
|
await Connection.ExecuteAsync("DELETE FROM MailCopy WHERE FolderId = ?", folder.Id);
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ public class MailService : BaseDatabaseService, IMailService
|
|||||||
|
|
||||||
_logger.Debug("Deleting mail {Id} from folder {FolderName}", mailCopy.Id, mailCopy.AssignedFolder.FolderName);
|
_logger.Debug("Deleting mail {Id} from folder {FolderName}", mailCopy.Id, mailCopy.AssignedFolder.FolderName);
|
||||||
|
|
||||||
await Connection.DeleteAsync<MailCopy>(mailCopy).ConfigureAwait(false);
|
await Connection.DeleteAsync<MailCopy>(mailCopy.UniqueId).ConfigureAwait(false);
|
||||||
|
|
||||||
// If there are no more copies exists of the same mail, delete the MIME file as well.
|
// If there are no more copies exists of the same mail, delete the MIME file as well.
|
||||||
var isMailExists = await IsMailExistsAsync(mailCopy.Id).ConfigureAwait(false);
|
var isMailExists = await IsMailExistsAsync(mailCopy.Id).ConfigureAwait(false);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class SignatureService(IDatabaseService databaseService) : BaseDatabaseSe
|
|||||||
|
|
||||||
public async Task<AccountSignature> DeleteSignatureAsync(AccountSignature signature)
|
public async Task<AccountSignature> DeleteSignatureAsync(AccountSignature signature)
|
||||||
{
|
{
|
||||||
await Connection.DeleteAsync<AccountSignature>(signature);
|
await Connection.DeleteAsync<AccountSignature>(signature.Id);
|
||||||
|
|
||||||
return signature;
|
return signature;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user