Files
InServiceQue/InServiceQue.Sample/Program.cs
2024-03-10 00:43:57 +07:00

14 lines
452 B
C#

using InServiceQue.Core.Models;
using InServiceQue.Core.Repositories;
using InServiceQue.Sample;
var builder = WebApplication.CreateBuilder(args);
builder.Services.RegisterInternals();
builder.Services.RegisterQueues();
var app = builder.Build();
app.MapGet("/", (string msg) => app.Services.GetService<ITaskRepository>().Insert(new QueueTask(new SendMessageTask(new SendMessagePayload(){To = "John", From = "Garry", Message = msg}))));
app.Run();