Make services aot compatible.

This commit is contained in:
Burak Kaan Köse
2025-11-14 14:28:10 +01:00
parent d9ef81729f
commit 8cb8f27e00
8 changed files with 58 additions and 57 deletions
+5 -5
View File
@@ -19,7 +19,7 @@ public class ContactService : BaseDatabaseService, IContactService
{
var contact = new AccountContact() { Address = address, Name = displayName };
await Connection.InsertAsync(contact).ConfigureAwait(false);
await Connection.InsertAsync(contact, typeof(AccountContact)).ConfigureAwait(false);
return contact;
}
@@ -57,11 +57,11 @@ public class ContactService : BaseDatabaseService, IContactService
{
if (currentContact == null)
{
await Connection.InsertAsync(info).ConfigureAwait(false);
await Connection.InsertAsync(info, typeof(AccountContact)).ConfigureAwait(false);
}
else if (!currentContact.IsRootContact && !currentContact.IsOverridden) // Don't update root contacts or overridden contacts.
{
await Connection.InsertOrReplaceAsync(info).ConfigureAwait(false);
await Connection.InsertOrReplaceAsync(info, typeof(AccountContact)).ConfigureAwait(false);
}
}
catch (Exception ex)
@@ -95,7 +95,7 @@ public class ContactService : BaseDatabaseService, IContactService
// Mark the contact as overridden when manually updated
contact.IsOverridden = true;
await Connection.UpdateAsync(contact).ConfigureAwait(false);
await Connection.UpdateAsync(contact, typeof(AccountContact)).ConfigureAwait(false);
return contact;
}
@@ -106,7 +106,7 @@ public class ContactService : BaseDatabaseService, IContactService
if (contact != null && !contact.IsRootContact)
{
await Connection.DeleteAsync(contact).ConfigureAwait(false);
await Connection.DeleteAsync<AccountContact>(contact).ConfigureAwait(false);
}
}