c# - Making Visual Studio 2012 generate singular table names from a model -
i created model database table in visual studio 2012, , generated controller class , views (create.cshtml, edit.cshtml, etc.) using entity framework. generation tool pluralizes table name. table name person, , generated table name persons.
is there way configure visual studio generate singular table name?
override onmodelcreating method , add:
protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.conventions.remove<pluralizingtablenameconvention>(); base.onmodelcreating(modelbuilder); } if using ado.net entity data model wizard, on last page select tables there checkbox option also. it's pretty annoying doesn't default using table names in database
Comments
Post a Comment