Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BsonValue for Insert return type in Repository as per documentation #2194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -150,4 +150,4 @@ public interface ILiteRepository : IDisposable
/// </summary>
T SingleOrDefault<T>(Expression<Func<T, bool>> predicate, string collectionName = null);
}
}
}
4 changes: 2 additions & 2 deletions LiteDB/Client/Database/LiteRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ 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);
}
Expand Down Expand Up @@ -342,4 +342,4 @@ protected virtual void Dispose(bool disposing)
}
}
}
}
}