1

I know the IDisposable conversion question has been asked a lot of times, however I haven't found any of them dealing with something similar to my situation. I'm working on an Entity Framework REST web service. My server project consists of a first project connected to the database in which I created the model and of another project taking care of the service part (data contracts and so on). My second project includes a reference to the first, however when trying to query the database with using (var db = new LibraryContext()) { I get the "type used in a using statement must be implicitly convertible to System.IDisposable" error. And I don't get why it says this error here while I'm able to use the same line in the other project. Could anyone please help me?

4

1 回答 1

1

它是说 LibraryContext 没有实现 IDisposable 所以你不能在 using 语句中使用它。所以要么你不需要 using 要么你需要让它实现接口 IDisposable

于 2013-06-08T23:34:45.333 回答