Giter VIP home page Giter VIP logo

dntcommon.web.core's Introduction

DNTCommon.Web.Core

GitHub Actions status

DNTCommon.Web.Core provides common scenarios' solutions for ASP.NET Core 1.1.x, 2.x and 3.x applications.

Install via NuGet

To install DNTCommon.Web.Core, run the following command in the Package Manager Console:

PM> Install-Package DNTCommon.Web.Core

You can also view the package page on NuGet.

Usage

After installing the DNTCommon.Web.Core package, to register its default providers, call services.AddDNTCommonWeb(); method in your Startup class.

using DNTCommon.Web.Core;

namespace MyWebApp
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDNTCommonWeb();
        }

Features

  • ActionResults

  • Caching

    • ICacheService encapsulates IMemoryCache functionalities.
    • [NoBrowserCache] action filter sets no-cache, must-revalidate, no-store headers for the current Response.
  • DependencyInjection

    • IServiceProviderExtensions creates an IServiceScope which contains an IServiceProvider used to resolve dependencies from a newly created scope and then runs an associated callback.
  • Drawing

  • Http

  • Mail

    • IWebMailService simplifies sending an email using the MailKit library. It's able to use razor based email templates.
  • ModelBinders

    • PersianDateModelBinderProvider parses an incoming Persian date and then binds it to a DateTime property automatically. To use it globally (assuming your app only sends Persian dates to the server), Add it to MvcOptions: services.AddMvc(options => options.UsePersianDateModelBinder()) or just apply it to an specific view-model [ModelBinder(BinderType = typeof(PersianDateModelBinder))].
    • YeKeModelBinderProvider parses an incoming text and then corrects its Ye & Ke characters automatically. To use it globally, Add it to MvcOptions: services.AddMvc(options => options.UseYeKeModelBinder()) or just apply it to an specific view-model [ModelBinder(BinderType = typeof(YeKeModelBinder))].
  • Mvc

  • Security

    • [AjaxOnly] action filter determines whether the HttpRequest's X-Requested-With header has XMLHttpRequest value.
    • IProtectionProviderService is an encryption provider based on Microsoft.AspNetCore.DataProtection.IDataProtector. It's only useful for short-term encryption scenarios such as creating encrypted HTTP cookies.
    • IFileNameSanitizerService determines whether the requested file is safe to download to avoid Directory Traversal & File Inclusion attacks.
    • UploadFileExtensions attribute determines only selected file extensions are safe to be uploaded.
    • AllowUploadSafeFiles attribute disallows uploading dangerous files such as .aspx, web.config and .asp files.
    • AntiDosMiddleware is a rate limiter and throttling middleware for ASP.NET Core apps. To use it first add app.UseAntiDos() and services.Configure<AntiDosConfig> to Startup.cs file. Then complete the AntiDosConfig section of the appsettings.json file.
    • IAntiXssService provides a cleaning service for unsafe HTML fragments that can lead to XSS attacks based on a whitelist of allowed tags and attributes. To use it add services.Configure<AntiXssConfig> to Startup.cs file. Then complete the AntiXssConfig section of the appsettings.json file.

dntcommon.web.core's People

Contributors

vahidn avatar hamed-shirbandi avatar

Watchers

James Cloos 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.