CommonNetFuncs.Core 3.2.1

dotnet add package CommonNetFuncs.Core --version 3.2.1                
NuGet\Install-Package CommonNetFuncs.Core -Version 3.2.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommonNetFuncs.Core" Version="3.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CommonNetFuncs.Core --version 3.2.1                
#r "nuget: CommonNetFuncs.Core, 3.2.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CommonNetFuncs.Core as a Cake Addin
#addin nuget:?package=CommonNetFuncs.Core&version=3.2.1

// Install CommonNetFuncs.Core as a Cake Tool
#tool nuget:?package=CommonNetFuncs.Core&version=3.2.1                

CommonNetFuncs.Core

nuget

This lightweight project contains helper methods for several common functions required by applications.

Contents


Async

Helper methods for dealing with asynchronous processes. <details> <summary><h3>Usage Examples</h3></summary>

ObjectUpdate

Asynchronously update properties of a class using ObjectUpdate

//Fill the Name and Address property using async tasks
Person person = new();

//AsyncIntString helper class is used for int and string types since they can't otherwise be gotten asynchronously like this
AsyncIntString personPhotoLocation = new();

person.Id = 1;
List<Task> tasks =
[
    person.ObjectUpdate(nameof(Person.Name), GetPersonNameByIdAsync(person.Id)), //Fills person.Name with results of GetPersonNameByIdAsync(person.Id)

    person.ObjectUpdate(nameof(Person.Address), GetPersonAddressByIdAsync(person.Id)), //Fills person.Address with results of GetPersonAddressByIdAsync(person.Id)

    personPhotoLocation.ObjectUpdate(nameof(AsyncIntString.AsyncString), GetPersonPhotoLocationById(person.Id)) //Fills personPhotoLocation.AsyncString with the results of GetPersonPhotoLocationById(person.Id)
]
await Task.WhenAll(tasks);
ObjectFill

Object fill can be used to asynchronously fill classes and lists with.

Person person = new();
ConcurrentBag<Person> people = [];
List<Task> tasks =
[
    person.ObjectUpdate(GetPersonById(1)), //person is filled by results of GetPersonById(1) which returns type Person

    //people is filled by the results of all three calls to GetPeopleByState additively (all results will be present in people)
    people.ObjectUpdate(GetPeopleByState("Ohio")),
    people.ObjectUpdate(GetPeopleByState("California")),
    people.ObjectUpdate(GetPeopleByState("Texas"))
]
await Task.WhenAll(tasks);

</details>


Collections

Collections Usage Examples

Helper methods that work with collections such as IEnumerable, List, IDictionary, ConcurrentBag, and DataTable

<details> <summary><h3>Usage Examples</h3></summary>

AnyFast

Used to address issue CA1860 where it suggests using .Count for performance in an easier to type extension method

bool x = collection?.Any() == true;
//Or
collection?.Count > 0;
//Becomes
bool x = collection.AnyFast();
AddDictionaryItem & AddDictionaryItems

Used to directly TryAdd a KeyValuePair object(s) to a dictionary

KeyValuePair<string, string> JsonContentHeader = new("Content-Type", "application/json");

//Single addition
ConcurrentDictionary<string, string>? httpHeaders = [];
httpHeaders.AddDictionaryItem(JsonContentHeader);

//Add multiples
List<KeyValuePair<string, string>> keyValuePairs = [new("Accept-Encoding", "br"), new("Accept-Encoding", "gzip")];
httpHeaders.AddDictionaryItems(keyValuePairs);
AddRange & AddRangeParallel

[Description]

SetValue & SetValueParallel

[Description]

SelectNonEmpty

[Description]

SelectNonNull

[Description]

SingleToList

[Description]

GetObjectByPartial

[Description]

ToList

[Description]

ToListParallel

[Description]

ToDataTable

[Description]

ToDataTableReflection

[Description]

CombineExpressions

[Description]

StringAggProps

[Description]

IndexOf

[Description]

</details>


Copy

Copy Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

DateOnlyHelpers

DateHelpers Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

DateTimeHelpers

DateHelpers Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

DimensionScale

DimensionScale Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

ExceptionLocation

ExceptionLocation Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

FileHelpers

FileHelpers Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

Inspect

Inspect Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

MathHelpers

MathHelpers Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

Random

Random Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

RunBatches

RunBatches Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

Streams

Streams Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

Strings

Strings Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

TypeChecks

TypeChecks Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here

</details>

UnitConversion

UnitConversion Usage Examples

[Description here]

<details> <summary><h3>Usage Examples</h3></summary>

[MethodNameHere]
//Code here
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages (20)

Showing the top 5 NuGet packages that depend on CommonNetFuncs.Core:

Package Downloads
CommonNetFuncs.EFCore

Helper methods that deal with EFCore, including providing basic actions against a DB Context and handling navigation properties.

CommonNetFuncs.Web.Aws.S3

Helper methods that deal with AWS S3 interactions

CommonNetFuncs.Sql.Common

Helper methods that deal with preparing and executing queries.

CommonNetFuncs.DeepClone

Helper methods that deal with deep cloning objects (copying an object without a memory reference).

CommonNetFuncs.Web.Requests

Helper methods that deal with creating, sending, and handling the responses from REST API calls

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.2.1 44 1/7/2025
3.2.0 190 12/19/2024
3.1.5 106 12/16/2024
3.1.2 142 12/13/2024
3.1.0 248 12/6/2024
3.0.0 206 12/3/2024
2.1.3 207 12/3/2024
2.1.0 197 12/2/2024
2.0.5 187 11/26/2024
2.0.3 95 11/20/2024
2.0.2 233 11/18/2024
2.0.1 185 11/15/2024
2.0.0 196 11/14/2024
1.0.47 227 11/14/2024
1.0.42 266 11/12/2024
1.0.40 252 11/12/2024
1.0.37 292 11/4/2024
1.0.31 249 10/31/2024
1.0.28 270 10/25/2024
1.0.26 273 10/18/2024
1.0.25 196 10/17/2024 1.0.25 is deprecated because it has critical bugs.
1.0.24 192 10/17/2024
1.0.19 267 10/11/2024
1.0.17 392 9/27/2024
1.0.16 234 9/27/2024
1.0.14 245 9/23/2024
1.0.13 255 9/18/2024
1.0.12 339 9/18/2024
1.0.10 312 9/11/2024
1.0.9 311 9/11/2024
1.0.8 356 9/11/2024
1.0.7 366 9/11/2024
1.0.6 144 9/9/2024
1.0.5 134 9/5/2024
1.0.4 138 9/5/2024
1.0.3 132 9/4/2024
1.0.2 120 9/4/2024
1.0.1 321 9/4/2024
1.0.0 290 9/2/2024