2016-12-03 4 views
1
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

に変換することはできません。あなたは間違いなく、あなたのアクションCreate(投稿)にEmployeController employeを渡します。あなたの実際のモデルでそれを変更してください。

関連する問題