I am trying to delete an object using Entity Framework and on all the tutorials on the internet I found that in order to do that you have to call the DeleteObject m
DeleteObject
Are you using a DbContext or an ObjectContext? If you have a DbContext you need to use the Remove function:
public void DeleteBook(int bookId) { Book book = (Book)bookContext.Books.Where(b => b.Id == bookId).First(); bookContext.Books.Remove(book); }