title: CS0121: The call is ambiguous between the following methods or properties:
body: <p>I am learning  Entity Framework in MVC from</p>
  
  <p><a href="https://www.youtube.com/watch?v=8f4P8U1a2TI" rel="nofollow">https://www.youtube.com/watch?v=8f4P8U1a2TI</a></p>
  
  <p>When i placed Html.DisplayNameFor() in 3rd row of html in foreach loop .It give following Error :</p>
  
  <blockquote>
    <p>CS0121: The call is ambiguous between the following methods or
    properties:
    'System.Web.Mvc.Html.DisplayNameExtensions.DisplayNameFor
    and</p>
    
    <p>'System.Web.Mvc.Html.DisplayNameExtensions.DisplayNameFor,MvcApplication1.Models.Department></p>
  </blockquote>
  
  <p>I have double Checked html Tags . but coudnt find issue</p>
  
  <p>Index View :</p>
  
  <pre><code>    @model IEnumerable&lt;MvcApplication1.Models.Employee&gt;
  @{
      ViewBag.Title = "Index";
  }
  &lt;div style="font-family"&gt;
      &lt;h2&gt;
          Index&lt;/h2&gt;
      &lt;p&gt;
          @Html.ActionLink("Create New", "Create")
      &lt;/p&gt;
  &lt;/div&gt;
  &lt;table border="1"&gt;
      &lt;tr&gt;
          &lt;th&gt; &lt;/th&gt;
          &lt;th&gt; &lt;/th&gt;
          &lt;th&gt;  &lt;/th&gt;
      &lt;/tr&gt;
      @foreach (var item in Model)
      {
          &lt;tr&gt;
              &lt;td&gt;  &lt;/td&gt;
              &lt;td&gt;  &lt;/td&gt;
              &lt;td&gt;  @Html.DisplayNameFor(modelItem =&gt; item.Name)   &lt;/td&gt;
          &lt;/tr&gt;
      }
  &lt;/table&gt;
  </code></pre>
  
  <p>I search other posts .. could not find relevant.
  Please suggest</p>
  
  <p>Employee Controller</p>
  
  <pre><code>namespace MvcApplication1.Controllers
  {
      public class EmployeeController : Controller
      {
          private EmployeeContext1 db = new EmployeeContext1();
  
          //
          // GET: /Employee/
  
          public ActionResult Index()
          {
              var employees = db.Employees.Include("Department");
              return View(employees.ToList());
          }
  
          //
          // GET: /Employee/Details/5
  
          public ActionResult Details(int id = 0)
          {
              Employee employee = db.Employees.Single(e =&gt; e.Id == id);
              if (employee == null)
              {
                  return HttpNotFound();
              }
              return View(employee);
          }
  
          //
          // GET: /Employee/Create
  
          public ActionResult Create()
          {
              ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name");
              return View();
          }
  
          //
          // POST: /Employee/Create
  
          [HttpPost]
          public ActionResult Create(Employee employee)
          {
              if (ModelState.IsValid)
              {
                  db.Employees.AddObject(employee);
                  db.SaveChanges();
                  return RedirectToAction("Index");
              }
  
              ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name", employee.DepartmentId);
              return View(employee);
          }
  
          //
          // GET: /Employee/Edit/5
  
          public ActionResult Edit(int id = 0)
          {
              Employee employee = db.Employees.Single(e =&gt; e.Id == id);
              if (employee == null)
              {
                  return HttpNotFound();
              }
              ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name", employee.DepartmentId);
              return View(employee);
          }
  
          //
          // POST: /Employee/Edit/5
  
          [HttpPost]
          public ActionResult Edit(Employee employee)
          {
              if (ModelState.IsValid)
              {
                  db.Employees.Attach(employee);
                  db.ObjectStateManager.ChangeObjectState(employee, System.Data.EntityState.Modified);
                  db.SaveChanges();
                  return RedirectToAction("Index");
              }
              ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name", employee.DepartmentId);
              return View(employee);
          }
  
          //
          // GET: /Employee/Delete/5
  
          public ActionResult Delete(int id = 0)
          {
              Employee employee = db.Employees.Single(e =&gt; e.Id == id);
              if (employee == null)
              {
                  return HttpNotFound();
              }
              return View(employee);
          }
  
          //
          // POST: /Employee/Delete/5
  
          [HttpPost, ActionName("Delete")]
          public ActionResult DeleteConfirmed(int id)
          {
              Employee employee = db.Employees.Single(e =&gt; e.Id == id);
              db.Employees.DeleteObject(employee);
              db.SaveChanges();
              return RedirectToAction("Index");
          }
  
          protected override void Dispose(bool disposing)
          {
              db.Dispose();
              base.Dispose(disposing);
          }
      }
  }
  </code></pre>
  
  <p>Model is autoGenerated by Entity Framework</p>