Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi frds,
i built one application in mvc5 for CRUD operation. But edit function not working...
pls help me





here is action methods:


XML
public ActionResult Edit(int id)
{
    Mapper.CreateMap<TMSInterface.Models.EmployeeRole, TMSInterface.Models.EmpRole>();
    var d = t.EmployeeRoles.Single(x => x.Id == id);
   var c= Mapper.Map<TMSInterface.Models.EmployeeRole, TMSInterface.Models.EmpRole>(d);
   return View("edit",c);

}
public ActionResult updat(TMSInterface.Models.EmployeeRole  eed)
{


    Mapper.CreateMap<TMSInterface.Models.EmpRole,TMSInterface.Models.EmployeeRole>();
        var d = t.EmployeeRoles.FirstOrDefault(x => x.Id == eed.Id);
        var c = Mapper.Map<TMSInterface.Models.EmployeeRole, TMSInterface.Models.EmpRole>(d);
        t.SaveChanges();
        return RedirectToAction("List","EmployeeRole");
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900