开发者

Entity Error in GDataDB example

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 as开发者_开发百科sembly 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 Entity type, make sure you get the whole sample project and not just Program.cs

GDataDB has no relationship to EF or LINQ-to-SQL at all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜