Im getting the error “the type or namespace name ‘Entity’ could not be found” from the following code snippet.
So ive added the reference “System.Data.Entity” but its still not working…
Why is that?
Error 1 The type or namespace name ‘Entity’ could not be found (are you missing a using directive or an assembly reference?)…
using System;
using System.Linq;
using GDataDB;
using GDataDB.Linq;
using System.Data.Entity;
....
Console.WriteLine("Connecting");
var client = new DatabaseClient("you@gmail.com", "password");
const string dbName = "testing";
Console.WriteLine("Opening or creating database");
var db = client.GetDatabase(dbName) ?? client.CreateDatabase(dbName);
const string tableName = "testtable";
Console.WriteLine("Opening or creating table");
var t = db.GetTable<Entity>(tableName) ?? db.CreateTable<Entity>(tableName);
Console.WriteLine("Feed url for this table is '{0}'", t.GetFeedUrl());
var all = t.FindAll();
Console.WriteLine("{0} elements", all.Count);
....
There is no
using System.Data.Entity;in the GDataDB sample app, and never has been, so either you or some automated tool added it.So simply remove it.
If you’re missing the
Entitytype, make sure you get the whole sample project and not just Program.csGDataDB has no relationship to EF or LINQ-to-SQL at all.