Git Product home page Git Product logo

mongoasyncenumerableadapter's People

Contributors

i3arnon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mongoasyncenumerableadapter's Issues

Potential `NullReferenceException` at runtime

In ToAsyncEnumerable you've checked for null in:

Debug.Assert(source is null ^ cursor is null);

but that check won't get executed in Release builds. Which means in production you'll get a NullReferenceException from the ! in this line:

cursor ??= await source!.ToCursorAsync(cancellationToken).ConfigureAwait(false);

You should always check for null at runtime and never use the ! operator.

The C# compiler is quite smart at figuring out when things can't be null. If you ever need to use the ! operator, there's a strong chance you've made a mistake somewhere and might get a NullReferenceException at runtime.

Every collection record gets pulled and enumerated

This is just a heads up to the dev and potential library users. When using this library to convert the IMongoCollection to an AsyncEnumerable, it will enumerate every collection record in order to execute whatever linq method you use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.