2020-10-21 14:02:20 +02:00
|
|
|
using System.Text.Json;
|
2020-11-17 13:46:23 +01:00
|
|
|
using BTCPayServer.Abstractions.Models;
|
2020-10-21 14:02:20 +02:00
|
|
|
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|
|
|
|
2020-11-17 13:46:23 +01:00
|
|
|
namespace BTCPayServer.Abstractions.Extensions
|
2020-10-21 14:02:20 +02:00
|
|
|
{
|
|
|
|
public static class SetStatusMessageModelExtensions
|
|
|
|
{
|
|
|
|
public static void SetStatusMessageModel(this ITempDataDictionary tempData, StatusMessageModel statusMessage)
|
|
|
|
{
|
|
|
|
if (statusMessage == null)
|
|
|
|
{
|
|
|
|
tempData.Remove("StatusMessageModel");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
tempData["StatusMessageModel"] = JsonSerializer.Serialize(statusMessage, new JsonSerializerOptions());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|