Danijel Boksan
Danijel Boksan

Reputation: 789

c# a namespace cannot directly contain members such as fields or methods

Can anyone tell what is wrong here ? I just create one folder call Models and add new class BaseEntity, and I get error. Till now I didn't get this error when I add new class...

enter image description here

Upvotes: 0

Views: 1129

Answers (2)

someguy76
someguy76

Reputation: 425

Namespaces cannot start with numbers.

You will have to change the name of your model 3DBook and then change the reference

Upvotes: 3

Christian.K
Christian.K

Reputation: 49310

An identifier cannot start with a number; 3DBool in this case is invalid.

Reference, older but still correct: it must start with either a letter or the underscore character (including or excluding the @ character to disambiguate it with keywords).

Upvotes: 5

Related Questions