All Projects → RickStrahl → Westwind.AspNetCore

RickStrahl / Westwind.AspNetCore

Licence: MIT license
ASP.NET Core Helpers and Utilities

Programming Languages

C#
18002 projects
HTML
75241 projects
CSS
56736 projects

Westwind.AspNetCore

Utility library providing useful helpers, formatters and extensions for ASP.NET Core

NuGet Pre Release

This is a small helper package that provides a number of small helper and extension classes that facilitate common operations in ASP.NET Core and MVC applications.

Westwind.AspnetCore.Markdown has moved

The Westwind.AspnetCore.Markdown sub-component has moved to its own repository:

Westwind.AspNetCore.Markdown on GitHub

Installation

You can install the package from NuGet in Visual Studio:

Westwind.AspnetCore Package

PM> install-package westwind.aspnetcore

or the dotnet command line:

dotnet add package westwind.aspnetcore

Westwind.AspnetCore.Markdown Package

There is also a separate package for Westwind.AspNetCore.Markdown which provides a Markdown TagHelper and Markdown Parsing services:

PM> install-package westwind.aspnetcore.markdown

or the dotnet command line:

dotnet add package westwind.aspnetcore.markdown

Features

Api Functionality

  • Api Error Handling Filter
    A custom API error filter implementation that returns API responses on exceptions. Also provides a standardized ApiExecption class that can be used to force responses with specific HTTP response codes.

  • 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.

MVC Functionality

  • 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 or

  • 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.

  • Bootstrap Alert ErrorDisplay Tag Helper and Controller Support Feature
    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() or ShowInfo() on BaseViewModel make it very easy to display error and informational messages on pages.

General ASP.NET Core

  • HttpRequest Extensions

    • GetBodyStringAsync() and GetRawBodyBytesAsync() - retrieve raw non-JSON content
    • MapPath() - Map virtual path to physical path on disk
    • Params() - Return an item from Form, Query or Session collections.
  • UserState Helper
    The UserState object greatly simplifies working with auth 'cached' token data more easily by storing a single value in a user claim or forms auth ticket that can be easily restored into an typed object. The class supports easily serialization and auto-loading from Claims. Can be extended by subclassing and adding your own values.

License

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.

Give back

If you find this library useful, consider making a small donation:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].