mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-31 15:19:28 +02:00
Add project files.
This commit is contained in:
commit
b2325a46ef
1351 changed files with 48136 additions and 0 deletions
34
Models/Responses/ToastResult.cs
Normal file
34
Models/Responses/ToastResult.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue