CS1503参数1:无法转换为' Employee.Controllers.EmployeController'到' Employee.Table'雇员

时间:2016-12-03 09:35:35

标签: c# asp.net-mvc

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);
        }

1 个答案:

答案 0 :(得分:1)

我认为你的问题很明显。你错误地在你的动作Create(post)中传递了s.。用你的实际模型改变它。