BarbezDotEu.Generic
3.0.1
Prefix Reserved
dotnet add package BarbezDotEu.Generic --version 3.0.1
NuGet\Install-Package BarbezDotEu.Generic -Version 3.0.1
<PackageReference Include="BarbezDotEu.Generic" Version="3.0.1" />
<PackageVersion Include="BarbezDotEu.Generic" Version="3.0.1" />
<PackageReference Include="BarbezDotEu.Generic" />
paket add BarbezDotEu.Generic --version 3.0.1
#r "nuget: BarbezDotEu.Generic, 3.0.1"
#:package BarbezDotEu.Generic@3.0.1
#addin nuget:?package=BarbezDotEu.Generic&version=3.0.1
#tool nuget:?package=BarbezDotEu.Generic&version=3.0.1
BarbezDotEu.Generic
Contents
<a name='T-BarbezDotEu-Generic-LinqHelper'></a>
LinqHelper type
Namespace
BarbezDotEu.Generic
Summary
Generic helper extension method adapted for Linq from multiple sources, including: https://stackoverflow.com/questions/2019417/how-to-access-random-item-in-list and http://www.albahari.com/nutshell/predicatebuilder.aspx.
<a name='M-BarbezDotEu-Generic-LinqHelper-GenerateRandomList1-System-Collections-Generic-IEnumerable{
0},System-Int32-'></a>
GenerateRandomList``1(source,numberOfItems) method
Summary
Generates a randomized list of a specified length from a given IEnumerable`1. If the required size exceeds the collection, elements are repeatedly selected.
Returns
A randomized list.
Parameters
Name | Type | Description |
---|---|---|
source | System.Collections.Generic.IEnumerable{``0} | The source collection. |
numberOfItems | System.Int32 | The number of items required. |
Generic Types
Name | Description |
---|---|
T | The type of elements. |
<a name='M-BarbezDotEu-Generic-LinqHelper-PickRandom1-System-Collections-Generic-IEnumerable{
0}-'></a>
PickRandom``1(source) method
Summary
Selects a random single item from a given IEnumerable`1.
Returns
A randomly chosen item from the collection.
Parameters
Name | Type | Description |
---|---|---|
source | System.Collections.Generic.IEnumerable{``0} | The source collection. |
Generic Types
Name | Description |
---|---|
T | The type of elements in the collection. |
Exceptions
System.InvalidOperationException: Thrown if the source collection is empty.
<a name='M-BarbezDotEu-Generic-LinqHelper-PickRandom1-System-Collections-Generic-IEnumerable{
0},System-Int32-'></a>
PickRandom``1(source,count) method
Summary
Picks a specified number of random items from a given IEnumerable`1. If the requested count is larger than the collection size, all available items are returned.
Returns
A random subset of items.
Parameters
Name | Type | Description |
---|---|---|
source | System.Collections.Generic.IEnumerable{``0} | The source collection. |
count | System.Int32 | The number of items to retrieve. |
Generic Types
Name | Description |
---|---|
T | The type of elements in the collection. |
<a name='M-BarbezDotEu-Generic-LinqHelper-Shuffle1-System-Collections-Generic-IEnumerable{
0}-'></a>
Shuffle``1(source) method
Summary
Randomly shuffles a given collection.
Returns
A shuffled version of the original collection.
Parameters
Name | Type | Description |
---|---|---|
source | System.Collections.Generic.IEnumerable{``0} | The collection to shuffle. |
Generic Types
Name | Description |
---|---|
T | The type of elements in the collection. |
<a name='M-BarbezDotEu-Generic-LinqHelper-True``1'></a>
True``1() method
Summary
Returns an expression that always evaluates to true.
Generic Types
Name | Description |
---|---|
T | The type of the expression. |
<a name='M-BarbezDotEu-Generic-LinqHelper-False``1'></a>
False``1() method
Summary
Returns an expression that always evaluates to false.
Generic Types
Name | Description |
---|---|
T | The type of the expression. |
<a name='M-BarbezDotEu-Generic-LinqHelper-Or1-System-Linq-Expressions-Expression{System-Func{
0,System-Boolean}},System-Linq-Expressions-Expression{System-Func{``0,System-Boolean}}-'></a>
Or``1(expr1,expr2) method
Summary
Combines two boolean expressions using a logical OR operation.
Returns
A combined expression that evaluates to true if either input expression evaluates to true.
Parameters
Name | Type | Description |
---|---|---|
expr1 | System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}} | The first expression. |
expr2 | System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}} | The second expression. |
Generic Types
Name | Description |
---|---|
T | The type of the expressions. |
<a name='M-BarbezDotEu-Generic-LinqHelper-And1-System-Linq-Expressions-Expression{System-Func{
0,System-Boolean}},System-Linq-Expressions-Expression{System-Func{``0,System-Boolean}}-'></a>
And``1(expr1,expr2) method
Summary
Combines two boolean expressions using a logical AND operation.
Returns
A combined expression that evaluates to true only if both input expressions evaluate to true.
Parameters
Name | Type | Description |
---|---|---|
expr1 | System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}} | The first expression. |
expr2 | System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}} | The second expression. |
Generic Types
Name | Description |
---|---|
T | The type of the expressions. |
<a name='T-BarbezDotEu-Generic-ReflectionHelper'></a>
ReflectionHelper type
Namespace
BarbezDotEu.Generic
Summary
Provides reflection-based helper extension methods. Adapted from https://stackoverflow.com/a/1954663 and other sources.
<a name='M-BarbezDotEu-Generic-ReflectionHelper-GetPropertyValue``1-System-Object,System-String-'></a>
GetPropertyValue``1(object,propertyName) method
Summary
Retrieves the value of a specified property from an object. Example usage:
Parameters
Name | Type | Description |
---|---|---|
object | System.Object | The source object. |
propertyName | System.String | The name of the property, supporting nested properties. |
Generic Types
Name | Description |
---|---|
T | The expected type of the property value. |
Returns
The property value if found; otherwise, the default value of T
.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on BarbezDotEu.Generic:
Package | Downloads |
---|---|
BarbezDotEu.Sudoku.Generator
This package generates Sudoku games. |
|
BarbezDotEu.Millennial
Pretend it's 2004 and encode a text like a millennial would on MSN Messenger. Decode them too! BarbezDotEu.Millennial is able to 'deobfuscate' (i.e. decode) a text by removing select Unicode lookalikes of letters and replace them with its corresponding character from the English alphabet. At the same time, it can also 'obfuscate' (i.e. encode) a text into an alternative text containing random emojis and other 'strange' characters, just like a millennial would back then. |
GitHub repositories
This package is not used by any popular GitHub repositories.