All Projects → Beffyman → AspNetCore.Client

Beffyman / AspNetCore.Client

Licence: MIT license
On Build client generator for asp.net core projects

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to AspNetCore.Client

BestForYouRecipes
Best For You recipes site in Blazor
Stars: ✭ 63 (+350%)
Mutual labels:  aspnetcore, blazor
serverlessnotifications
Serverless notifications with Azure Cosmos DB + Azure Functions + Azure SignalR
Stars: ✭ 60 (+328.57%)
Mutual labels:  azure-functions, signalr
Home
Home for Blazor Extensions
Stars: ✭ 51 (+264.29%)
Mutual labels:  aspnetcore, blazor
SdvCodeWebsite
Simeon Valev - Personal Blog - Developed on ASP.NET Core MVC - Server-Side Blazor - See README.md file for more information
Stars: ✭ 38 (+171.43%)
Mutual labels:  signalr, blazor
ant-design-blazor
Ant Design for Blazor (WIP)
Stars: ✭ 23 (+64.29%)
Mutual labels:  aspnetcore, blazor
TextMood
A Xamarin + IoT + Azure sample that detects the sentiment of incoming text messages, performs sentiment analysis on the text, and changes the color of a Philips Hue lightbulb
Stars: ✭ 52 (+271.43%)
Mutual labels:  azure-functions, signalr
CfpExchange
An online community website used to share interesting call for papers with speakers.
Stars: ✭ 24 (+71.43%)
Mutual labels:  aspnetcore, azure-functions
Aspnetcoreangularsignalr
SignalR ASP.NET Core Angular
Stars: ✭ 163 (+1064.29%)
Mutual labels:  aspnetcore, signalr
Fritz.HatCollection
A static website that displays a collection of Fritz's Hats
Stars: ✭ 21 (+50%)
Mutual labels:  azure-functions, blazor
BlazoredLocalStorage
This library has been moved to the Blazored org
Stars: ✭ 26 (+85.71%)
Mutual labels:  aspnetcore, blazor
memealyzer
Memealyzer is an app built to demonstrate some the latest and greatest Azure tech to dev, debug, and deploy microservice applications.
Stars: ✭ 97 (+592.86%)
Mutual labels:  azure-functions, blazor
PugetSound
PugetSound allows you and your group to enjoy music together using Spotify.
Stars: ✭ 52 (+271.43%)
Mutual labels:  aspnetcore, signalr
rpirobot
A Raspberry Pi Robot Arm using .NET 5
Stars: ✭ 24 (+71.43%)
Mutual labels:  signalr, blazor
AspNetCore6Experiments
ASP.NET Core Blazor BFF with Azure AD and Razor page
Stars: ✭ 43 (+207.14%)
Mutual labels:  aspnetcore, blazor
Aspnetcoreangularsignalrsecurity
Security with ASP.NET Core, SignalR and Angular
Stars: ✭ 171 (+1121.43%)
Mutual labels:  aspnetcore, signalr
pokeR
Planning poker with SignalR
Stars: ✭ 37 (+164.29%)
Mutual labels:  aspnetcore, signalr
Signalrsimplechat
.NET 5 - ASP.NET Core 5 SignalR Simple Chat
Stars: ✭ 95 (+578.57%)
Mutual labels:  aspnetcore, signalr
Aspnetcore Angular Ngrx
🚀 An ASP.NET Core WebAPI Demo with an Angular Client using Ngrx store and effects and Signalr
Stars: ✭ 141 (+907.14%)
Mutual labels:  aspnetcore, signalr
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (+235.71%)
Mutual labels:  aspnetcore, blazor
TheLastTime
C# .NET 5 Blazor WebAssembly Progressive Web Application that tracks when was the last time you did something
Stars: ✭ 23 (+64.29%)
Mutual labels:  aspnetcore, blazor

Beffyman.AspNetCore.Client

Build Status

If you are anything like me, you look at

using(var client = new HttpClient())
{
	var request = await client.GetAsync($"api/mysuperspecialroute/{id}");
	//Now to make sure what came back is what is expected, in every case...
}

and think the following

  • Why not just inject clients?
    • services.AddTestWebClients();!
  • How can I pool the HttpClient usage?
    • HttpClient is injected! Which allows you to control it's lifecycle
  • Yuck, hard coded routes, these can lead to issues if my endpoint is still under development.
    • Generated On Build! Beffyman.AspNetCore.Client.Generator is a before compile build task that will generate clients inside the project that implements it.
  • How do I unit test this without spinning up a full web app?
    • Works with Microsoft.AspNetCore.TestHost!
      • CancellationTokens are not respected inside the TestServer without some hacks though (registering a kill of the server) due to the Token not being checked.
  • How do I tell my teammates that an endpoint has headers it requires?
    • HeaderParameterAttribute! Which makes a header a parameter inside the generated methods, which may or may not be required.
    • IncludeHeaderAttribute! Which defines a constant header value to be included
  • How do I tell my teammates that an endpoint has known response types for status codes?
    • ProducesResponseType! Generates action parameters that allow custom logic depending on the status code returned, without needing to manually check it.
  • What if sometimes I want to intercept requests before they go out?
    • IHttpOverride! Which allows for potential cache interception of requests.
  • If I own the endpoint's code, why can't I just generate clients from it to make interacting with it as simple as injecting it?
    • Introducing Beffyman.AspNetCore.Client.Generator!

First Time Setup

Supported Frameworks

  • AspNetCore 3.1 HTTP Controllers
  • AspNetCore 3.1 SignalR Hubs
  • AspNetCore 3.1 Blazor Client Side
  • Http Trigger Azure Functions v3

Beffyman.AspNetCore.Client

NuGet

Includes ServiceCollection registration logic, used on the Client

Beffyman.AspNetCore.Client.Generator

NuGet

On Build generator that will generate a Clients.cs file based on the Properties in the csproj.

Beffyman.AspNetCore.Server

NuGet

Includes attributes that can affect generation, used on your AspNetCore api app

Beffyman.AspNetCore.Client.Protobuf

NuGet

Contains a protobuf serializer which can override the default json one via the UseProtobufSerlaizer on the ClientConfiguration.

services.AddTestWebClients(config=>
{
	config.UseProtobufSerializer()
			.UseProtobufDeserializer()
			.WithProtobufBody();
});

Beffyman.AspNetCore.Client.MessagePack

NuGet

Contains a MessagePack serializer which can override the default json one via the UseMessagePackSerializer on the ClientConfiguration.

Requires version 1.7.3.7 at the moment due to dotnet/aspnetcore#18074

services.AddTestWebClients(config=>
{
	config.UseMessagePackSerializer()
			.UseMessagePackDeserializer()
			.WithMessagePackBody();
});

Beffyman.AspNetCore.Client.NewtonsoftJson

NuGet

Contains a Newtonsoft Json serializer which can override the default json one via the UseNewtonsoftJsonHttpSerializer on the ClientConfiguration.

services.AddTestWebClients(config=>
{
	config.UseNewtonsoftJsonHttpSerializer()
			.UseNewtonsoftJsonHttpDeserializer()
			.WithJsonBody();
});

Beffyman.AspNetCore.Client.Http

NuGet

Uses Microsoft.Extensions.Http to inject a client factory. This allows for better reuse of the underlying HttpMessageHandler.

services.AddTestWebClients(config=>
{
	config.UseHttpClientFactory<ITestWebAppClient>();
});
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].