![]() |
VOOZH | about |
dotnet add package Westwind.AspNetCore --version 4.1.8
NuGet\Install-Package Westwind.AspNetCore -Version 4.1.8
<PackageReference Include="Westwind.AspNetCore" Version="4.1.8" />
<PackageVersion Include="Westwind.AspNetCore" Version="4.1.8" />Directory.Packages.props
<PackageReference Include="Westwind.AspNetCore" />Project file
paket add Westwind.AspNetCore --version 4.1.8
#r "nuget: Westwind.AspNetCore, 4.1.8"
#:package Westwind.AspNetCore@4.1.8
#addin nuget:?package=Westwind.AspNetCore&version=4.1.8Install as a Cake Addin
#tool nuget:?package=Westwind.AspNetCore&version=4.1.8Install as a Cake Tool
👁 alternate text is missing from this package README image
This is a small package that provides a number of convenience helper and extension classes that facilitate common operations in ASP.NET Core API and MVC applications and ASP.NET Core in general.
You can use this package as is or use the source code to pick and choose pieces to add to your own applications - most features are self-contained and easily moved and integrated.
You can install the package from NuGet in Visual Studio:
PM> install-package westwind.aspnetcore
or the dotnet command line:
dotnet add package westwind.aspnetcore
A class reference for the library can be found here:
FormVariableBinding unbinds forms to an Object
Request.Form unbind routine that allows you to unbind form variables into an existing object only updating properties that are are available in the request form context. This can in many instances be much easier to use than Model binding which creates new objects and so requires tracking changes.
Custom Http Headers Middleware
Allows adding and removing of HTTP headers to every request using middleware configuration. It's a missing piece in the ASP.NET Core base libraries.
HttpRequest Extensions
GetBodyStringAsync() and GetRawBodyBytesAsync() - retrieve raw non-JSON contentGetUrl() - Returns the Absolute URL for the current request.Params() - Return an item from Form, Query or Session collections.IsFormVar() - Determines if a Form variable existsIsPostback() - Determines if request is a Post/Put operationIsLocal - Determines if the current URL is a local machine URLUnbindFormVars() - unbinds form vars into an object (uses FormVariable Binder)HttpContext Extensions
MapPath() - Map virtual path to physical path on diskResolvePath() - resolves a relative path to a fully qualified site path (~/, /)SetUserLocale() - lets you easily set User locale and UiLocale for a requestDataProtector Wrapper
Helper to make it easier to use the DataProtector API to create secure tokens.
UserState Helper
The UserState object greatly simplifies working with auth 'cached' user data that can be stored across requests. Useful for caching things like username, main IDs to reduce data base lookups or simply to carry global values across requests. Data is stored either in an Identity Claim or a custom encrypted cookie. The class supports easily serialization and auto-loading and saving. Can be extended by subclassing and adding your own custom properties to track beyond several common ones.
WeUtils
EncodeJsString() - string encoding for Json without library requirementsDecodeJsString() - string decoding for Json without library requirementsEncodeJsDate() - data encoding for Json without library requirementsGravatar
Gravatar class that quickly lets you embed a GravatarLink() and GravatarImage() into pages.
BaseController and BaseViewModel implementation
A common base controller class that adds support for an auto-initialized BaseViewModel from which other VMs can inherit. Allows for automatic initialization of common features like ErrorDisplay and Base View models.
ViewRenderer
Render Razor/MVC view output to a string using a controller context.
AppUser ClaimsPrincipal and Cookie Authentication Helper
A AppUser class that wraps a ClaimsPrincipal and makes it easier to add and retrieve claims as well as easily login and logout all from a single helper object.
Razor Error Display Component based on Bootstrap Alert
Provides an <error-display> razor component that you model bind directly, or you can use the built in ErrorDisplayModel on the BaseViewModel class in overloaded ViewModel components of your own.
In most MVC applications you need some sort of error display and this ErrorDisplay TagHelper makes it quick easy to display an Alert box from a custom ErrorDisplayModel input. Helper methods like ShowError(), ShowSuccess() or ShowInfo() on BaseViewModel make it very easy to display error and informational messages on pages, consistently
BaseApiController API base class that includes exception trapping and display and can be used with UserState that is passed through requests from Auth tokens or other custom auth mechanism. Similar to BaseControl but optimized for API operation.
ApiExceptionFilter Error Handling and ApiException
A custom API error filter implementation that returns JSON API responses on exceptions. Also provides a standardized ApiExecption class that can be used to easily throw exceptions that returns specific HTTP response codes.
Api Base Response Object
ApiResponse base class that can be used to return consistent API results that include error status, error message, status code as well as the actual data. Both typed and untyped versions.
RawRequest Body String Formatter
API formatter that allows for receiving raw non-json content to string and byte[] parameters, which otherwise isn't supported by MVC's API implementation. More info in blog post.
Moved to Westwind.Utilities.Data
JWT Helper Make it easier to create JWT Tokens in the ASP.NET Auth configuration
The Westwind.Web.MarkdownControl library is an open source product licensed under:
All source code is © West Wind Technologies, regardless of changes made to them. Any source code modifications must leave the original copyright code headers intact if present.
There's no charge to use, integrate or modify the code for this project. You are free to use it in personal, commercial, government and any other type of application and you are free to modify the code for use in your own projects.
If you find this library useful, please consider starring the repository and/or consider making a small donation:
Version 4.0
Physically removed UserTokenManager from the package (see v3.20 for initial deprecation).
Version 3.20
Removed the UserTokenManager class from this package and moved it into Westwind.Utilities.Data in order to remove the default footprint for the SQL libraries from this package.
The structure of the UserTokens table for UserTokenManager has changed with some additional fields. The table has to be updated to include additional fields. If your DB has write access for the connection string you can delete the table and let it rebuild. Otherwise look at the UserTokenManager.CreateUserTokenSqlTable() method for the latest structure and SQL statement.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 3 NuGet packages that depend on Westwind.AspNetCore:
| Package | Downloads |
|---|---|
|
Tyle_Evmos
Package Description |
|
|
Tyle.Nft
Package Description |
|
|
TyleCSC
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.8 | 853 | 5/13/2026 |
| 4.1.7 | 143 | 5/11/2026 |
| 4.1.6 | 122 | 5/5/2026 |
| 4.1.5 | 310 | 4/9/2026 |
| 4.1.4 | 535 | 1/15/2026 |
| 4.1.2 | 269 | 12/28/2025 |
| 4.1.1 | 650 | 11/20/2025 |
| 4.1.0 | 361 | 11/13/2025 |
| 4.0.14 | 12,952 | 3/9/2025 |
| 4.0.12 | 401 | 3/7/2025 |
| 4.0.9 | 584 | 3/6/2025 |
| 4.0.7 | 3,531 | 8/4/2024 |
| 4.0.6 | 289 | 7/27/2024 |
| 4.0.5 | 440 | 7/18/2024 |
| 4.0.4 | 461 | 6/26/2024 |
| 4.0.3 | 728 | 4/28/2024 |
| 4.0.2 | 1,459 | 2/17/2024 |
| 4.0.1 | 325 | 2/15/2024 |