I have an Action in My controller that calls a Service that does a Search using Stored Procedure and returns me a List. I made the form in the View to call this Action, only it is not calling Follow the Codes for each Process
Search Form
<p> Buscar Pessoa </p>
<!-- Area de Busca -->
@using (Html.BeginForm())
{
@Html.ValidationSummary()
<div class="form-group">
<p> Nome </p>
@Html.TextBox("Nome")
<input type="submit" value="Buscar" />
</div>
}
Controller - ActionResult Search (string name)
[HttpPost]
public ActionResult Buscar(string Nome)
{
PessoaService srv = new PessoaService();
srv.Buscar(ID);
return View("List", srv.Listar());
}
Search for Person by Stored Procedure - in PersonService
public List<Pessoa> Buscar(string nome)
{
using(var db = new MyContext())
{
var Result = db.Database.SqlQuery<Pessoa>("SP_Busca_Cliente").ToList();
return Result.ToList();
}
}
QUESTION ---- How do I call this Action and Return the Wanted Person