Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AndreasReitberger.Shared.Core.Interfaces;
using SQLite;
using SQLite;

namespace AndreasReitberger.Shared.Core.Database.Interfaces
{
Expand Down Expand Up @@ -30,6 +29,8 @@ public interface ISqliteDatabaseService : IDisposable
public Task<T?> GetWithChildrenAsync<T>(object primaryKey, bool recursive) where T : new();
public Task InsertWithChildrenAsync<T>(T insert, bool replace = false, bool recursive = true) where T : new();
public Task InsertAllWithChildrenAsync<T>(IList<T> insert, bool replace = false, bool recursive = true) where T : new();
public Task UpdateWithChildrenAsync<T>(T insert, bool recursive = true) where T : new();
public Task UpdateAllWithChildrenAsync<T>(IList<T> insert, bool recursive = true) where T : new();
public Task<int> DeleteWithChildrenAsync<T>(object primaryKey) where T : new();
public List<TableMapping>? GetTableMappings();
public Task<List<int>> DropAllTableAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ public async Task DisconnectAsync()
await Database.InsertAllWithChildrenAsync(insert, recursive: recursive).ConfigureAwait(false);
}
}

public Task UpdateWithChildrenAsync<T>(T insert, bool recursive = true) where T : new()
=> InsertWithChildrenAsync(insert, replace: true, recursive);

public Task UpdateAllWithChildrenAsync<T>(IList<T> insert, bool recursive = true) where T : new()
=> InsertAllWithChildrenAsync(insert, replace: true, recursive);

public async Task<int> DeleteWithChildrenAsync<T>(object primaryKey) where T : new()
{
if (Database is not null)
Expand Down
Loading