All Projects → OrleansContrib → Orleans.HttpGateway.AspNetCore

OrleansContrib / Orleans.HttpGateway.AspNetCore

Licence: Apache-2.0 License
No description or website provided.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Orleans.HttpGateway.AspNetCore

Templates
.NET project templates with batteries included, providing the minimum amount of code required to get you going faster.
Stars: ✭ 2,864 (+5866.67%)
Mutual labels:  asp-net-core, orleans
vscode-csharp-snippets
Extension of C# Snippets for Visual Studio Code
Stars: ✭ 22 (-54.17%)
Mutual labels:  asp-net-core
AdminLTE-Starter-Kit
AdminLTE Starter Kit for ASP.NET Core
Stars: ✭ 91 (+89.58%)
Mutual labels:  asp-net-core
AspNetCore.Mvc.FluentActions
Fluent Actions for ASP.NET Core MVC are abstractions of regular MVC actions that are converted into MVC actions during startup.
Stars: ✭ 17 (-64.58%)
Mutual labels:  asp-net-core
ASP.NETCoreMVA
Microsoft Virtual Academy MVA
Stars: ✭ 82 (+70.83%)
Mutual labels:  asp-net-core
FlashCards
Learning Blazor By Creating A Flash Cards Application
Stars: ✭ 17 (-64.58%)
Mutual labels:  asp-net-core
Something-about-aspnetcore-book
The Something about ASP.NET Core Book is introduction to web programming and based on ASP.NET Core 2.2
Stars: ✭ 35 (-27.08%)
Mutual labels:  asp-net-core
AspNet-Core-REST-Service
VS2017/VS2019 project template for ASP.Net Core 3.1/5.0 to create fully functional production ready RESTful services
Stars: ✭ 57 (+18.75%)
Mutual labels:  asp-net-core
Blazor.Pagination
A reusable pagination component for Blazor.
Stars: ✭ 27 (-43.75%)
Mutual labels:  asp-net-core
serilog-enrichers-clientinfo
Enrich logs with client IP and UserAgent.
Stars: ✭ 42 (-12.5%)
Mutual labels:  asp-net-core
xperience-training-13
Kentico Xperience 13 training website
Stars: ✭ 18 (-62.5%)
Mutual labels:  asp-net-core
mediatr-netcore-sample
Example of using mediatr with asp.net core
Stars: ✭ 14 (-70.83%)
Mutual labels:  asp-net-core
CoreShop
基于 Asp.Net Core 5.0、Uni-App开发,支持可视化布局的小程序商城系统,前后端分离,支持分布式部署,跨平台运行,拥有分销、代理、团购、拼团、秒杀、直播、优惠券、自定义表单等众多营销功能,拥有完整SKU、下单、售后、物流流程。支持一套代码编译发布微信小程序版、H5版、Android版、iOS版、支付宝小程序版、字节跳动小程序版、QQ小程序版等共10个平台。
Stars: ✭ 278 (+479.17%)
Mutual labels:  asp-net-core
Orleans.SyncWork
This package's intention is to expose an abstract base class to allow https://github.com/dotnet/orleans/ to work with long running CPU bound synchronous work, without becoming overloaded.
Stars: ✭ 31 (-35.42%)
Mutual labels:  orleans
MediatrTutorial
CQRS implementation in ASP.NET Core using MediatR in .NET 5
Stars: ✭ 88 (+83.33%)
Mutual labels:  asp-net-core
PluginCore
ASP.NET Core lightweight plugin framework. ASP.NET Core 轻量级 插件框架 - 一分钟集成
Stars: ✭ 127 (+164.58%)
Mutual labels:  asp-net-core
chess
Chess (game)(♟) built in C# and ASCII art.
Stars: ✭ 20 (-58.33%)
Mutual labels:  orleans
vctr
vctr is a self hosted short link management tool.
Stars: ✭ 14 (-70.83%)
Mutual labels:  asp-net-core
BlazorWasmWithDocker
Companion code sample for my blog post - Containerising a Blazor WebAssembly App
Stars: ✭ 16 (-66.67%)
Mutual labels:  asp-net-core
UrlBase64
A standards-compliant implementation of web/url-safe base64 encoding and decoding for .NET targets
Stars: ✭ 25 (-47.92%)
Mutual labels:  asp-net-core

Orleans.HttpGateway.AspNetCore

a http gateway for Microsoft Orleans.

Build status Nuget version

Installation

Install-Package Orleans.HttpGateway.AspNetCore

Configuring the gateway

Startup.cs

public void ConfigureService(IServiceCollection services)
{
    // add known grain interface assemblies
    Assembly grainInterfaceAssembly = GetGrainInterfacesAssembly();
    services.AddOrleansHttpGateway(c => c.AddAssemblies(grainInterfaceAssembly));

    // ensure IGrainFactory is registered in the service container
    services.AddSingleton<IGrainFactory>(GetGrainFactory());
}

public void Configure(IApplicationBuilder app)
{
    // register the middleware in the application
    // note: the middleware internally uses Microsoft.AspNetCore.Routing
    // default route is: "{grainInterface}/{grainId}/{grainMethod}"
    app.UseOrleansHttpGateway();
}

IMPORTANT: Please note that ALL grains are accessible with this gateway, it is adviceable to not publicly expose the endpoint and use any of the default methods to securing your web app

Calling grains with http client

Grainmethods can be invoked using the following url format

http://your.aspnet.url/{grainInterface}/{grainId}/{grainMethod}

example: http://localhost:5000/Orleans.HttpGateway.AspNetCore.Tests.ITestGrain3/6/GetObjectWith2Parameters?one=1&two=okay

Providing method parameters

given the following grain interface:

public interface ITestGrain : IGrainWithStringKey
{
    Task<int> TestGrainMethod(string p1, bool p2, string[]p3);
}

parameters can be supplied by QueryParameters for GET requests, e.g. ?p1=one&p2=true&p3=[a,b,c]

complex parameters can also be provided in the request body using PUT or POST, names of the root elements must match the variable names in the GrainInterface and contenttype must be application/json:

{
    "p1":"one",
    "p2":true,
    "p3": ["a","b","c"]
}

note: not supplied values will default to null in the resulting grain call

Using Compound Grain Keys

Compound keys can be provided, seperated with a , e.g for an IGrainWithIntegerCompoundKey: http://localhost:5000/Orleans.HttpGateway.AspNetCore.Tests.ITestGrain3/1234,myStringkey/GetObjectWith2Parameters?one=1&two=okay

Acknowledgements

this project uses ObjectMethodExecutor from https://github.com/aspnet/Common/tree/dev/shared/Microsoft.Extensions.ObjectMethodExecutor.Sources

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