techgarage-ir.MTWireGuard/Models/Responses/ToastResult.cs
2023-03-03 23:24:18 +03:30

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);
}
}
}