diff --git a/Images/logo.png b/Images/logo.png
new file mode 100644
index 00000000..3a1c0b7b
Binary files /dev/null and b/Images/logo.png differ
diff --git a/src/Akavache.Core/BlobCache/CacheEntry.cs b/src/Akavache.Core/BlobCache/CacheEntry.cs
index de0f98b9..68ed2ae7 100644
--- a/src/Akavache.Core/BlobCache/CacheEntry.cs
+++ b/src/Akavache.Core/BlobCache/CacheEntry.cs
@@ -17,7 +17,6 @@ namespace Akavache;
/// The date and time when the entry expires.
public class CacheEntry(string? typeName, byte[] value, DateTimeOffset createdAt, DateTimeOffset? expiresAt)
{
-
///
/// Gets or sets the date and time when the entry was created.
///
diff --git a/src/Akavache.Core/BlobCache/IObjectWrapper.cs b/src/Akavache.Core/BlobCache/IObjectWrapper.cs
index 40636a71..d3ad1fcc 100644
--- a/src/Akavache.Core/BlobCache/IObjectWrapper.cs
+++ b/src/Akavache.Core/BlobCache/IObjectWrapper.cs
@@ -8,6 +8,4 @@ namespace Akavache;
///
/// A wrapper around a object.
///
-internal interface IObjectWrapper
-{
-}
\ No newline at end of file
+internal interface IObjectWrapper;
\ No newline at end of file
diff --git a/src/Akavache.Core/BlobCache/ISecureBlobCache.cs b/src/Akavache.Core/BlobCache/ISecureBlobCache.cs
index 6535c4bb..83d5b4f6 100644
--- a/src/Akavache.Core/BlobCache/ISecureBlobCache.cs
+++ b/src/Akavache.Core/BlobCache/ISecureBlobCache.cs
@@ -15,6 +15,4 @@ namespace Akavache;
/// saved to disk cannot be easily read by a third party.
///
///
-public interface ISecureBlobCache : IBlobCache
-{
-}
+public interface ISecureBlobCache : IBlobCache;
diff --git a/src/Akavache.Core/BlobCache/InMemoryBlobCache.cs b/src/Akavache.Core/BlobCache/InMemoryBlobCache.cs
index d37a5604..c2b5875b 100644
--- a/src/Akavache.Core/BlobCache/InMemoryBlobCache.cs
+++ b/src/Akavache.Core/BlobCache/InMemoryBlobCache.cs
@@ -59,7 +59,7 @@ public InMemoryBlobCache(IEnumerable> initialConten
public InMemoryBlobCache(IScheduler? scheduler, IEnumerable>? initialContents)
{
Scheduler = scheduler ?? CurrentThreadScheduler.Instance;
- foreach (var item in initialContents ?? Enumerable.Empty>())
+ foreach (var item in initialContents ?? [])
{
_cache[item.Key] = new(null, item.Value, Scheduler.Now, null);
}
@@ -155,7 +155,7 @@ public IObservable Insert(string key, byte[] data, DateTimeOffset? absolut
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
lock (_cache)
@@ -168,7 +168,7 @@ public IObservable Insert(string key, byte[] data, DateTimeOffset? absolut
///
public IObservable Flush() => _disposed ?
- ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache") :
+ ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache)) :
Observable.Return(Unit.Default);
///
@@ -176,7 +176,7 @@ public IObservable Get(string key)
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
CacheEntry? entry;
@@ -211,7 +211,7 @@ public IObservable Get(string key)
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
CacheEntry? entry;
@@ -233,7 +233,7 @@ public IObservable> GetAllKeys()
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException>("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException>(nameof(InMemoryBlobCache));
}
lock (_cache)
@@ -250,7 +250,7 @@ public IObservable Invalidate(string key)
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
lock (_cache)
@@ -266,7 +266,7 @@ public IObservable InvalidateAll()
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
lock (_cache)
@@ -282,7 +282,7 @@ public IObservable InsertObject(string key, T value, DateTimeOffset? ab
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
var data = SerializeObject(value);
@@ -300,7 +300,7 @@ public IObservable GetObject(string key)
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
CacheEntry? entry;
@@ -340,7 +340,7 @@ public IObservable> GetAllObjects()
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException>("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException>(nameof(InMemoryBlobCache));
}
lock (_cache)
@@ -356,7 +356,7 @@ public IObservable> GetAllObjects()
///
public IObservable InvalidateObject(string key) => _disposed ?
- ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache") :
+ ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache)) :
Invalidate(key);
///
@@ -364,7 +364,7 @@ public IObservable InvalidateAllObjects()
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
lock (_cache)
@@ -384,7 +384,7 @@ public IObservable Vacuum()
{
if (_disposed)
{
- return ExceptionHelper.ObservableThrowObjectDisposedException("InMemoryBlobCache");
+ return ExceptionHelper.ObservableThrowObjectDisposedException(nameof(InMemoryBlobCache));
}
lock (_cache)
diff --git a/src/Akavache.Core/IsExternalInit.cs b/src/Akavache.Core/IsExternalInit.cs
index 793e71a6..fccfb653 100644
--- a/src/Akavache.Core/IsExternalInit.cs
+++ b/src/Akavache.Core/IsExternalInit.cs
@@ -8,6 +8,4 @@
namespace System.Runtime.CompilerServices;
[EditorBrowsable(EditorBrowsableState.Never)]
-internal class IsExternalInit
-{
-}
+internal class IsExternalInit;
diff --git a/src/Akavache.Sqlite3/IsExternalInit.cs b/src/Akavache.Sqlite3/IsExternalInit.cs
index 793e71a6..fccfb653 100644
--- a/src/Akavache.Sqlite3/IsExternalInit.cs
+++ b/src/Akavache.Sqlite3/IsExternalInit.cs
@@ -8,6 +8,4 @@
namespace System.Runtime.CompilerServices;
[EditorBrowsable(EditorBrowsableState.Never)]
-internal class IsExternalInit
-{
-}
+internal class IsExternalInit;
diff --git a/src/Akavache.Sqlite3/Operations/BulkInvalidateByTypeSqliteOperation.cs b/src/Akavache.Sqlite3/Operations/BulkInvalidateByTypeSqliteOperation.cs
index 9a91e241..5dcf8cca 100644
--- a/src/Akavache.Sqlite3/Operations/BulkInvalidateByTypeSqliteOperation.cs
+++ b/src/Akavache.Sqlite3/Operations/BulkInvalidateByTypeSqliteOperation.cs
@@ -9,6 +9,4 @@ namespace Akavache.Sqlite3;
// NB: This just makes OperationQueue's life easier by giving it a type
// name.
-internal class BulkInvalidateByTypeSqliteOperation(SQLiteConnection conn) : BulkInvalidateSqliteOperation(conn, true)
-{
-}
+internal class BulkInvalidateByTypeSqliteOperation(SQLiteConnection conn) : BulkInvalidateSqliteOperation(conn, true);
diff --git a/src/Akavache.Sqlite3/Operations/BulkInvalidateSqliteOperation.cs b/src/Akavache.Sqlite3/Operations/BulkInvalidateSqliteOperation.cs
index 1e3519b2..4b627ac2 100644
--- a/src/Akavache.Sqlite3/Operations/BulkInvalidateSqliteOperation.cs
+++ b/src/Akavache.Sqlite3/Operations/BulkInvalidateSqliteOperation.cs
@@ -47,7 +47,7 @@ public BulkInvalidateSqliteOperation(SQLiteConnection conn, bool useTypeInsteadO
public Action PrepareToExecute(IEnumerable? toDelete)
{
- var deleteList = (toDelete ?? Array.Empty()).ToList();
+ var deleteList = (toDelete ?? []).ToList();
if (deleteList.Count == 0)
{
return () => { };
diff --git a/src/Akavache.Sqlite3/Operations/BulkSelectByTypeSqliteOperation.cs b/src/Akavache.Sqlite3/Operations/BulkSelectByTypeSqliteOperation.cs
index d0d7c696..19659c8c 100644
--- a/src/Akavache.Sqlite3/Operations/BulkSelectByTypeSqliteOperation.cs
+++ b/src/Akavache.Sqlite3/Operations/BulkSelectByTypeSqliteOperation.cs
@@ -7,6 +7,4 @@
namespace Akavache.Sqlite3;
-internal class BulkSelectByTypeSqliteOperation(SQLiteConnection conn, IScheduler scheduler) : BulkSelectSqliteOperation(conn, true, scheduler)
-{
-}
+internal class BulkSelectByTypeSqliteOperation(SQLiteConnection conn, IScheduler scheduler) : BulkSelectSqliteOperation(conn, true, scheduler);
diff --git a/src/Akavache.Sqlite3/Operations/BulkSelectSqliteOperation.cs b/src/Akavache.Sqlite3/Operations/BulkSelectSqliteOperation.cs
index c9ecfae3..739d8ae5 100644
--- a/src/Akavache.Sqlite3/Operations/BulkSelectSqliteOperation.cs
+++ b/src/Akavache.Sqlite3/Operations/BulkSelectSqliteOperation.cs
@@ -50,10 +50,10 @@ public BulkSelectSqliteOperation(SQLiteConnection conn, bool useTypeInsteadOfKey
public Func> PrepareToExecute(IEnumerable? toSelect)
{
- var selectList = (toSelect ?? Array.Empty()).ToList();
+ var selectList = (toSelect ?? []).ToList();
if (selectList.Count == 0)
{
- return () => new List();
+ return () => [];
}
var selectOp = _selectOps[selectList.Count - 1];
diff --git a/src/Akavache.Sqlite3/Queues/OperationQueue.cs b/src/Akavache.Sqlite3/Queues/OperationQueue.cs
index 5ebb5b36..c63e7285 100644
--- a/src/Akavache.Sqlite3/Queues/OperationQueue.cs
+++ b/src/Akavache.Sqlite3/Queues/OperationQueue.cs
@@ -372,7 +372,7 @@ public void Dispose()
_shouldQuit?.Dispose();
}
- internal List DumpQueue() => _operationQueue.ToList();
+ internal List DumpQueue() => [.. _operationQueue];
private static void MarshalCompletion(object completion, Action block, IObservable commitResult)
{
diff --git a/src/Akavache.Sqlite3/Queues/OperationQueueCoalescing.cs b/src/Akavache.Sqlite3/Queues/OperationQueueCoalescing.cs
index b6178990..21fb8669 100644
--- a/src/Akavache.Sqlite3/Queues/OperationQueueCoalescing.cs
+++ b/src/Akavache.Sqlite3/Queues/OperationQueueCoalescing.cs
@@ -32,12 +32,13 @@ internal static List CoalesceOperations(List CoalesceUnrelatedItems(IEnumerabl
items.GroupBy(x => x.OperationType)
.SelectMany(group => group.Key switch
{
- OperationType.BulkSelectSqliteOperation => new[] { GroupUnrelatedSelects(group) },
- OperationType.BulkInsertSqliteOperation => new[] { GroupUnrelatedInserts(group) },
- OperationType.BulkInvalidateSqliteOperation => new[] { GroupUnrelatedDeletes(group) },
+ OperationType.BulkSelectSqliteOperation => [GroupUnrelatedSelects(group)],
+ OperationType.BulkInsertSqliteOperation => [GroupUnrelatedInserts(group)],
+ OperationType.BulkInvalidateSqliteOperation => [GroupUnrelatedDeletes(group)],
_ => (IEnumerable)group
});
@@ -116,7 +117,7 @@ private static IEnumerable MultipleOpsTurnIntoSingleOp(IEnum
{
if (item.OperationType == opTypeToDedup)
{
- currentWrites ??= new();
+ currentWrites ??= [];
currentWrites.Add(item);
continue;
}
@@ -185,9 +186,7 @@ private static OperationQueueItem GroupUnrelatedSelects(IEnumerable());
+ elementMap[v].OnNext(resultMap.TryGetValue(v, out var value) ? EnumerableEx.Return(value) : []);
elementMap[v].OnCompleted();
}
@@ -228,7 +227,7 @@ private static OperationQueueItem GroupUnrelatedInserts(IEnumerable
{
subj.Subscribe(x.CompletionAsUnit);
- return x.ParametersAsElements ?? Enumerable.Empty();
+ return x.ParametersAsElements ?? [];
}).ToList();
return OperationQueueItem.CreateInsert(
@@ -259,7 +258,7 @@ private static OperationQueueItem GroupUnrelatedDeletes(IEnumerable
{
subj.Subscribe(x.CompletionAsUnit);
- return x.ParametersAsKeys ?? Enumerable.Empty();
+ return x.ParametersAsKeys ?? [];
}).ToList();
return OperationQueueItem.CreateInvalidate(
@@ -292,21 +291,17 @@ private static OperationQueueItem GroupUnrelatedDeletes(IEnumerable? subjects, OperationType opType)
{
- var subjectsList = (subjects ?? Enumerable.Empty