Skip to content
NetFabricPublic

About

Defines .NET classes and structs common to other NetFabric projects

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

NetFabric

Defines classes and structs common to other NetFabric projects.

Throw

Defines a set of static methods to throw exceptions.

Methods that throw exceptions cannot be inlined by the JIT compiler. Only if thrown within a called method. Using the methods in this class allows exceptions to be thrown and still let the method be a candidate to be inlined.

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ReadOnlyListWrapper<T> AsReadOnlyList<T>(T[] source)
    => source switch
    {
        null => Throw.ArgumentNullException<ReadOnlyListWrapper<T>>(nameof(source)),
        _ => new ReadOnlyListWrapper<T>(source)
    };

Credits

The following open-source projects are used to build and test this project:

License

This project is licensed under the MIT license. See the LICENSE file for more info.

About

Defines .NET classes and structs common to other NetFabric projects

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages