mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-28 13:58:09 +02:00
34 lines
849 B
C#
34 lines
849 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace MTWireGuard.Models.Responses
|
|
{
|
|
public class ToastResult : IActionResult
|
|
{
|
|
private class Toast
|
|
{
|
|
public string Title { get; set; }
|
|
public string Body { get; set; }
|
|
public string Background { get; set; }
|
|
}
|
|
|
|
private readonly Toast _result;
|
|
|
|
public ToastResult(string title, string body, string background)
|
|
{
|
|
_result = new()
|
|
{
|
|
Title = title,
|
|
Body = body,
|
|
Background = background
|
|
};
|
|
}
|
|
|
|
public async Task ExecuteResultAsync(ActionContext context)
|
|
{
|
|
var objectResult = new ObjectResult(_result);
|
|
|
|
await objectResult.ExecuteResultAsync(context);
|
|
}
|
|
}
|
|
}
|