Reputation: 2855
I am new to Entity Framework. I am currently doing a project in ASP.NET, Crystal Reports and LINQ to SQL.
I have the following tables on the database and I created my DBML from the database
This didn't error out. I just realized the DBML creates Class(Objects) and I am wondering whether this is a correct naming convention for the tables.
It could be great if you can let me know about SQL Server table naming convention and also correct naming convention in Entity Framework.
Upvotes: 4
Views: 4016
Reputation: 10115
I use
TblTeachers , TblStudents
I am thinking of putting it as
TeachersTbl , StudentsTbl
The Intellisense has other classes which looks like these table names, for filtering them out easily, I use Tbl in the naming.
Upvotes: 0
Reputation: 14084
First of all I'm not a big fan of using "_" in the naming. I use UpperCamelCase instead.
For Tables :
I advice you to use Plural in all Entities tables:
And if the table is just representing many to many relation and has no other fields then I name it as two Singular parts :
That will represent these classes after mapping in EF :
And in the City class you'll have Users
property
Upvotes: 6