Передача структуры в контроллер из представления ASP.NET MVC core

Есть такой контроллер

[Authorize]
public class NotificationController : Controller
{
    private readonly ILogger<NotificationController> _logger;
    private readonly IReceivedNotifications _repositoryt;

    public NotificationController(ILogger<NotificationController> logger, IReceivedNotifications repositoryt)
    {
        _logger = logger;
        _repositoryt = repositoryt;
    }

    [HttpGet]
    public IActionResult CreateNotification()
    {
        return View();
    }

    [HttpPost]
    public IActionResult AddNotification([FromBody] Notifications notification, emaill)
    {
        ClaimsPrincipal currentUser = this.User;
        _repositoryt.AddNotification(currentUser.FindFirst(ClaimTypes.NameIdentifier).Value, emaill, notification);
        return View();
    }
}

И такое представление контроллера CreateNotification

<div class="text-center">
    @using (Html.BeginForm())
    {
        <div class="container">
            <div class="row">

                <label id="lemail">Email</label>
                <input type="text" id="Email" name="Email" />

                <label id="ldate">Date</label>
                <input type="text" id="Date" name="Date" />

                <label id="lmeassge">Text</label>
                <textarea id="meassge" name="meassge"></textarea>


                <div class="col-9">
                    <div class="row">
                        <input type="button" class="btn btn-default" value="Отправить" />
                    </div>
                </div>
            </div>
        </div>
    }
</div>

Подскажите как можно передать структуру Notifications и дополнительно строку с email, в POST AddNotification.


Ответы (0 шт):