From 1e34f9dc4559eed6c258d9cfc3cda989ccaed796 Mon Sep 17 00:00:00 2001 From: Phil Tolland Date: Wed, 7 Dec 2022 10:39:28 +0000 Subject: [PATCH] Change return type of ILiteRepository.Insert to match ILiteDatabase.Insert, and the documentation --- LiteDB/Client/Database/ILiteRepository.cs | 2 +- LiteDB/Client/Database/LiteRepository.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LiteDB/Client/Database/ILiteRepository.cs b/LiteDB/Client/Database/ILiteRepository.cs index 913cbbec8..92862d4c9 100644 --- a/LiteDB/Client/Database/ILiteRepository.cs +++ b/LiteDB/Client/Database/ILiteRepository.cs @@ -14,7 +14,7 @@ public interface ILiteRepository : IDisposable /// /// Insert a new document into collection. Document Id must be a new value in collection - Returns document Id /// - void Insert(T entity, string collectionName = null); + BsonValue Insert(T entity, string collectionName = null); /// /// Insert an array of new documents into collection. Document Id must be a new value in collection. Can be set buffer size to commit at each N documents diff --git a/LiteDB/Client/Database/LiteRepository.cs b/LiteDB/Client/Database/LiteRepository.cs index 0f7e67f1b..91a659bef 100644 --- a/LiteDB/Client/Database/LiteRepository.cs +++ b/LiteDB/Client/Database/LiteRepository.cs @@ -64,9 +64,9 @@ public LiteRepository(Stream stream, BsonMapper mapper = null, Stream logStream /// /// Insert a new document into collection. Document Id must be a new value in collection - Returns document Id /// - public void Insert(T entity, string collectionName = null) + public BsonValue Insert(T entity, string collectionName = null) { - _db.GetCollection(collectionName).Insert(entity); + return _db.GetCollection(collectionName).Insert(entity); } ///