mediatr, api, refit
This commit is contained in:
parent
cdabe27b0b
commit
dbc2a6d35e
13 changed files with 177 additions and 70 deletions
23
Sledgemapper.Api/Controllers/MapController.cs
Normal file
23
Sledgemapper.Api/Controllers/MapController.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sledgemapper.Api.Handlers;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sledgemapper.Api.Controllers
|
||||
{
|
||||
[Route("map")]
|
||||
public class MapController : ControllerBase
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public MapController(IMediator mediator) { _mediator = mediator; }
|
||||
|
||||
[HttpPost]
|
||||
[ActionName("tile")]
|
||||
public async Task Post(string sessionName, Tile tile)
|
||||
{
|
||||
await _mediator.Publish(new NewTileNotification(sessionName, tile));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue