A collection of .NET extension methods.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Brucraft.Extensions
test/Brucraft.Extensions.Tests
.gitattributes
.gitignore
Extensions.sln
LICENSE
README.md
build.ps1
publish.ps1
release.ps1

README.md

Getting Brucraft.Extensions

Brucraft.Extensions is available via NuGet:

Install-Package Brucraft.Extensions

This library has been developed to contain extension methods that I have created for multiple projects. I'm tired of rewriting the same code over and over again and thought it was about time to package these up. When writing extension methods, I always define them in the same namespace as the type they are extending. This allows the Brucraft.Extensions package to simply be added to a project without the need for adding a bunch of using statements.

Version 0.3.0

System.Collections.Generic.IEnumerable<T>

bool IsNullOrEmpty()

Determines if the collection is null or has no elements.

Version 0.2.1

Removes duplicate code files.

Version 0.2.0

Changed target frameworks to net45 and netstandard1.1.

System.Net.Http.HttpClient

Task<T> GetJsonAsync<T>(string requestUri)

This wil send a GET request to the specified Uri. The response will be deserialized into an instance of T.

Task<HttpResponseMessage> PostJsonAsync(string requestUri, object content)

This will send a POST request to the specified Uri. The specified content will be serialized to JSON and sent as the request body.

Task<T> PostJsonAsync<T>(string requestUri, object content)

This will send a POST request to the specified Uri. The specified content will be serialized to JSON and sent as the request body. The response will be deserialized into an instance of T.

System.Net.Http.HttpContent

Task<T> ReadAsJsonAsync<T>()

Version 0.1.0

System.DateTimeOffset

ToIsoString()

This formats a DateTimeOffset instance to an ISO 8601 string. Similar to the javascript Date.toISOString() function.