I got an old problem but I couldn't find correct answer here .
Can any body tell me the answer?
using System;
using System.Linq;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Data;
using System.Data.Entity;
using MvcApplication1.Models;
public ActionResult Edit(int id)
{
//return View();
var maintableToEdit = (from m in _DB.mainTable where m.Id = id select m).First();
return View(maintableToEdit);
}
Error 1 Cannot convert lambda expression to type 'string' because it is not a delegate type C:\Users\Administrator\Documents\Visual Studio 2008\Projects\localhost\MvcApplication1\Controllers\HomeController.cs 80 60 MvcApplication1
Error 3 'MvcApplication1.Models.mainTable' does not contain a definition for 'Id' and no extension method 'Id' accepting a first argument of type 'MvcApplication1.Models.mainTable' could be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2008\Projects\localhost\MvcApplication1\Controllers\HomeController.cs 81 68 MvcApplication1
Thank s a lot!!