I'm having an issue in Asp.net MVC, I have tried several suggestions and looking over Stack Overflow with no luck.
Here are the codes and details:
Exception :
An exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in EntityFramework.SqlServer.dll but was not handled in user code
Code:
Controller where it got exception:
namespace DataCrowds.Controllers
{
public class MarketplaceController : Controller
{
private ApplicationDbContext db = new ApplicationDbContext();
// GET: Marketplace
public ActionResult Index()
{
return View();
}
public PartialViewResult _SearchDataSets(string keyword)
{
System.Threading.Thread.Sleep(2000);
var data = db.DataSets.Where(f =>
f.title.Contains(keyword)).ToList();
return PartialView(data);
}
}
}
Inner Exception :
Class=16 ErrorCode=-2146232060 HResult=-2146232060 LineNumber=5 Message=Invalid column name 'ApplicationUser_Id'.
More Details (Image Screenshot)
Code first model:
namespace DataCrowds.Models
{
public class DataSet
{
public int Id { get; set; }
public string title { get; set; }
public string description { get; set; }
[NotMapped]
public HttpPostedFileBase file { get; set; }
}
}
And yes, I have tried to run migration and update-database.
Thx!