Please i want to use below statement to get Particular User Details From Database to View without assigning String Name to a specific Name(I want to Enter, let say Kumar in a different Page and get the user Details in another Page). Please this is Homework and i am finding things difficult.
Please Humble appeal. Any answer is kindly welcome and honored
This is My Controller
public async Task Index( )
{
using (var context = new UserDb())
{
string Name = " Kumar";
var Data = context.tbl_Employee.SqlQuery("SelectUserName @Name", new SqlParameter("@Name", Name)).ToList();
return View(Data);
}
}

Jignesh KumarRank #91 · 22.9K reputationPosted Apr 2, 2019, 11:59 PM EDT
Abhishek MishraRank #871 · 2.5K reputationPosted Apr 2, 2019, 7:15 PM EDT
Siddhartha SharmaRank #2,254 · 626 reputationPosted Apr 2, 2019, 7:16 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Apr 2, 2019, 7:58 PM EDT