mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Make wallet able to send to multiple destinations (#847)
* Make wallet able to send to multiple destinations * fix tests * update e2e tests * fix e2e part 2 * make headless again * pr changes * make wallet look exactly as old one when only 1 dest
This commit is contained in:
committed by
Nicolas Dorier
parent
3d436c3b0e
commit
88c931ec13
29
BTCPayServer/Extensions/ModelStateExtensions.cs
Normal file
29
BTCPayServer/Extensions/ModelStateExtensions.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures.Internal;
|
||||
|
||||
namespace BTCPayServer
|
||||
{
|
||||
public static class ModelStateExtensions
|
||||
{
|
||||
public static void AddModelError<TModel, TProperty>(
|
||||
this ModelStateDictionary modelState,
|
||||
Expression<Func<TModel, TProperty>> ex,
|
||||
string message
|
||||
)
|
||||
{
|
||||
var key = ExpressionHelper.GetExpressionText(ex);
|
||||
modelState.AddModelError(key, message);
|
||||
}
|
||||
|
||||
public static void AddModelError<TModel, TProperty>(this TModel source,
|
||||
Expression<Func<TModel, TProperty>> ex,
|
||||
string message,
|
||||
ModelStateDictionary modelState)
|
||||
{
|
||||
var key = ExpressionHelper.GetExpressionText(ex);
|
||||
modelState.AddModelError(key, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user