[CSHARP-4012] Remove checks for session been passed as null Created: 11/Jan/22 Updated: 27/Oct/23 Resolved: 20/Jan/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Jason Singleton | Assignee: | Dmitry Lukyanov (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently most calls that take a session validate its been passed though and don't accept null. This seems redundant on the session parameter. As on a users side we have to check if we have a session or not and call with different arguments when internally you accept null anyway. For an example the Find extensions methods require IClientSession but internally it just makes an instance of FindFluent which doesn't have the same restriction. So we can actually just make an instance of this and bypass the extension but shouldn't the extension methods have the same restrictions?
|
| Comments |
| Comment by Dmitry Lukyanov (Inactive) [ 20/Jan/22 ] |
|
Hello j.singleton7887@gmail.com , The API was deliberately designed to validate that the application does not pass a null session by mistake. |
| Comment by Boris Dogadov [ 14/Jan/22 ] |
|
Thank you j.singleton7887@gmail.com for your suggestion. We will look into this, and will update this ticket with our findings. |