0
從下面的代碼片段中,獲取錯誤「無法找到類型或名稱空間名稱」實體「」。 因此,我添加了參考「System.Data.Entity」,但它仍然不能正常工作...GDataDB示例中的實體錯誤
這是爲什麼?
錯誤1類型或命名空間名稱「實體」找不到(是否缺少using指令或程序集引用?)...
using System;
using System.Linq;
using GDataDB;
using GDataDB.Linq;
using System.Data.Entity;
....
Console.WriteLine("Connecting");
var client = new DatabaseClient("[email protected]", "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);
....
看起來您正在使用LINQ-to-SQL非實體框架。你必須爲'db.GetTable'提供一個有效的類 – Eranga