mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-04 01:53:52 +01:00
21 lines
592 B
C#
21 lines
592 B
C#
|
using System.Text.Json;
|
||
|
using BTCPayServer.Models;
|
||
|
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||
|
|
||
|
namespace BTCPayServer
|
||
|
{
|
||
|
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());
|
||
|
}
|
||
|
}
|
||
|
}
|