All Projects → m6t → M6T.Core.TupleModelBinder

m6t / M6T.Core.TupleModelBinder

Licence: Unlicense license
Asp.Net Core Tuple Model Binder

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to M6T.Core.TupleModelBinder

Yoyocmsfree.template
一个免费版本的ABP框架,整合了ng-Zorro。
Stars: ✭ 254 (+1170%)
Mutual labels:  asp-net-core
Demo.Ndjson.AsyncStreams
Sample project for demonstrating how to use async streams and NDJSON to improve user experience by streaming JSON objects from server to client and client to server in .NET
Stars: ✭ 30 (+50%)
Mutual labels:  asp-net-core
CleanArchitecture
Clean Architecture Solution for .NET 5
Stars: ✭ 18 (-10%)
Mutual labels:  asp-net-core
SeoTags
SeoTags create all SEO tags you need such as meta, link, twitter card (twitter:), open graph (og:), and JSON-LD schema (structred data).
Stars: ✭ 113 (+465%)
Mutual labels:  asp-net-core
SecureStore
A .NET implementation of the cross-platform SecureStore (symmetrically-encrypted secrets) protocol
Stars: ✭ 62 (+210%)
Mutual labels:  asp-net-core
admin-lte-dotnet
AdminLTE v3 for MVC Core, Razor Pages and Tag Helpers
Stars: ✭ 96 (+380%)
Mutual labels:  asp-net-core
Cqrs Clean Eventual Consistency
CQRS, using Clean Architecture, multiple databases and Eventual Consistency
Stars: ✭ 247 (+1135%)
Mutual labels:  asp-net-core
MPACore.PhoneBook
采用MVC+jQuery 的方式进行开发。
Stars: ✭ 51 (+155%)
Mutual labels:  asp-net-core
NETCore.MailKit
.NET Core EmailKit extensions
Stars: ✭ 102 (+410%)
Mutual labels:  asp-net-core
asp.net-core-tutorial
ASP.NET Core 入门教程
Stars: ✭ 42 (+110%)
Mutual labels:  asp-net-core
KentNoteBook
ASP.NET.Core and EF Core demo, JWT
Stars: ✭ 24 (+20%)
Mutual labels:  asp-net-core
generic-for-core
🏗️ Generic Repository & UOW Pattern For ASP.NET Core
Stars: ✭ 55 (+175%)
Mutual labels:  asp-net-core
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (+680%)
Mutual labels:  asp-net-core
Localization.AspNetCore.TagHelpers
Asp.Net Core Tag Helpers to use when localizing Asp.Net Core application instead of manually injecting IViewLocator
Stars: ✭ 25 (+25%)
Mutual labels:  asp-net-core
aspnetcore-authentication-apikey
Easy to use and very light weight Microsoft style API Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key in Header, Authorization Header, QueryParams or HeaderOrQueryParams.
Stars: ✭ 215 (+975%)
Mutual labels:  asp-net-core
Nlog.web
NLog integration for ASP.NET & ASP.NET Core 1-5
Stars: ✭ 252 (+1160%)
Mutual labels:  asp-net-core
Hexagonal-architecture-ASP.NET-Core
App generator API solution template which is built on Hexagnonal Architecture with all essential feature using .NET Core
Stars: ✭ 57 (+185%)
Mutual labels:  asp-net-core
squidex-identity
Identity Server for Squidex Headless CMS
Stars: ✭ 28 (+40%)
Mutual labels:  asp-net-core
Unicorn
ASP.NET Core System Architecture.
Stars: ✭ 14 (-30%)
Mutual labels:  asp-net-core
Home
Home for Blazor Extensions
Stars: ✭ 51 (+155%)
Mutual labels:  asp-net-core

M6T.Core.TupleModelBinder

This package only works with named tuples and JSON post body!!!. What this package does is simply provide bindings for your controllers that maps incoming json data to tuple object at runtime. so you dont have to create a class for all of your actions in mvc.

If you want to contribute just do it no rules. In fact some other incoming data formats and checking the request content type to bind them is very very wellcome :)

Installation

//Nuget
Install-Package M6T.Core.TupleModelBinder

//dotnet cli
dotnet add package M6T.Core.TupleModelBinder 

Usage

Modify startup.cs like

using M6T.Core.TupleModelBinder;
....

public void ConfigureServices(IServiceCollection services)
{
  services.AddMvc(options =>
  {
      options.ModelBinderProviders.Insert(0, new TupleModelBinderProvider());
  });
}

Post request body

{
  "user" : {
    "Name":"Test",
    "Surname":"Test2",
    "Email":"[email protected]"
  },
  "someData" : "If you like it, you put a data on it"
}

And in your controller use it like

[HttpPost]
public IActionResult CreateUser((User user, string someData) request)
{
    using (var db = new DBContext())
    {
        var newUser = db.Users.Add(request.user);
        db.SaveChanges();
        return Json(new { userId = request.user.Id, someData = request.someData});
    }
}
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].