I'm trying to delete an object in my asp.net MVC3/Code-first Entity Framework application, but I don't seem to have the necessary options, as it brings up a "does not contain a definition for DeleteObject" error. Anyone know if I'm missing an assembly reference. Here is my repository code:
private dbContext db = new dbContext();
public void DeleteAccessDetails(AccessDetails details)
{
db.DeleteObject(details); //error here as DeleteObject isn't recognised
}
Here are my references:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySite.Models;
using System.Data;
using System.Data.Objects;
using System.Web.Mvc;
using System.Data.Entity;
I thought having System.Data.Entity would have been enough to bring up DeleteObject, but intellisense is hardly bringing up any options - only Dispose, Entry, SaveChanges and Set
Edit: Here is also my code for accessing the repository:
Repository rep = new Repository();
AccessDetails paymentUpdate = rep.GetPaymentByID(item.AccessDetailsTableID);
rep.DeleteAccessDetails(paymentUpdate);
Edit 2: Here is an image of my references folder:
Thanks