Git Product home page Git Product logo

westwind.aspnetcore's Introduction

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:

westwind.aspnetcore's People

Contributors

rickstrahl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.