Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# CS1503和x9;参数1:无法从';Employee.controller.employeecontroller';至';Employee.Table' ;雇员_C#_Asp.net Mvc - Fatal编程技术网

C# CS1503和x9;参数1:无法从';Employee.controller.employeecontroller';至';Employee.Table' ;雇员

C# CS1503和x9;参数1:无法从';Employee.controller.employeecontroller';至';Employee.Table' ;雇员,c#,asp.net-mvc,C#,Asp.net Mvc,我认为你的问题很明显。您在创建(post)操作中错误地传递了EmployeController employe。根据您的实际型号进行更改 namespace Employee.Controllers { public class EmployeController : Controller { EmployeeEntities db = new EmployeeEntities(); // GET: Employe public A

我认为你的问题很明显。您在创建(post)操作中错误地传递了
EmployeController employe
。根据您的实际型号进行更改

namespace Employee.Controllers
{
    public class EmployeController : Controller
    {
        EmployeeEntities db = new EmployeeEntities();
        // GET: Employe
        public ActionResult Index()
        {
            return View(db.Tables.ToList());
        }
        // GET: Add Employee
        [HttpGet]
        public ActionResult Create()
        {
            return View();
        }
        [HttpPost]
        // POST
        public ActionResult Create(EmployeController employe)
        {
            if(ModelState.IsValid)
            {
                db.Tables.Add(employe);

            }
            return View(employe);
        }