Skip to content

Commit

Permalink
Merge pull request #2260 from InvisiblePhil/insert-return-type
Browse files Browse the repository at this point in the history
Thanks!
  • Loading branch information
mbdavid committed Mar 9, 2023
2 parents 7e70c20 + 1e34f9d commit b1e8260
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LiteDB/Client/Database/ILiteRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface ILiteRepository : IDisposable
/// <summary>
/// Insert a new document into collection. Document Id must be a new value in collection - Returns document Id
/// </summary>
void Insert<T>(T entity, string collectionName = null);
BsonValue Insert<T>(T entity, string collectionName = null);

/// <summary>
/// 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
Expand Down
4 changes: 2 additions & 2 deletions LiteDB/Client/Database/LiteRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public LiteRepository(Stream stream, BsonMapper mapper = null, Stream logStream
/// <summary>
/// Insert a new document into collection. Document Id must be a new value in collection - Returns document Id
/// </summary>
public void Insert<T>(T entity, string collectionName = null)
public BsonValue Insert<T>(T entity, string collectionName = null)
{
_db.GetCollection<T>(collectionName).Insert(entity);
return _db.GetCollection<T>(collectionName).Insert(entity);
}

/// <summary>
Expand Down

0 comments on commit b1e8260

Please sign in to comment.