简体   繁体   中英

Building Project that uses EntityFramework fails with a lot of errors

I am using EntityFramework as my Data Access Layer in a Visual Studio C# project. I have added a new entity model and built right away without adding or doing anything to test its functionality. Unfortunately, the build failed with many errors like:

CS0426  The type name 'Data' does not exist in the type 'System'
CS0138  A 'using namespace' directive can only be applied to namespaces; 'System' is a type not a namespace. Consider a 'using static' directive instead    
CS0246  The type or namespace name 'Nullable<>' could not be found (are you missing a using directive or an assembly reference?)

The code editor itself appears as though it is missing something even though every thing is in place

在此处输入图片说明 在此处输入图片说明

The pictures show both the editor and the references that I have in my project

PS: The project type is Class Library

Apparently, it is all my mistake. I had a table in the Database called "Systems" and when Entity Framework turned the plural into singular it became "System" class which caused confusion and ambiguity to the compiler. Consequently, the compiler could not correctly resolve the type.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM