0

I have a simple application to test asp.net core and when we test the Create Method the entity always comes null.

Follow the codes

enter image description here

@model PluralsightTestCore.Models.Beer

@{
    ViewData["Title"] = "Create";
}

<h2>Create</h2>

<h4>Beer</h4>
<hr />
<div class="row">
    <div class="col-md-4">

        <form asp-action="Create" method="post">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>

            <div class="form-group">
                <label asp-for="Nome" class="control-label"></label>
                <input asp-for="Nome" class="form-control"/>
                <span asp-validation-for="Nome" class="text-danger"></span>
            </div>

            <div class="form-group">
                <input type="submit" value="Create" class="btn btn-default"/>
            </div>
        </form>
    </div>
</div>
FabioNav
  • 1
  • 1

0 Answers0