views:

11

answers:

1

I was working with entity framework in a database first style. Each time I wanted to update my edmx file I did just that, ran update model.

The problem I now have is that I've lost my database (long boring story, it was on a disk that's been formatted and I don't have a backup). I thought I would be able to use the 'Generate Database from Model' option to at the least get the structure of my database back. The problem I have is that the tool automatically pluralises all the table names, so Cost becomes Costs and so on. This breaks the EF model as it is expecting the table Cost so I can no longer run an 'Update Model from Database' as the table Cost does not exist. How can I control the table tables that are used when generating a database from a model?

A: 

It turns out that the Entity Set Name property was wrong for all of my entities, changing that to a non pluralised version gave me a sql script that created the tables in a form that could then be synchronised with the EF model.

ilivewithian