我应该如何使用Entity Framework建模数据库?

时间:2022-10-05 12:27:10

I'm just starting to use Entity Framework Designer. I would like to ask how should I create my Entity files. I would like to have like 10 tables and all of them will be linked to at least one other table by some row. Should I create just one file and put all my models there or create a separate file for each model.

我刚刚开始使用Entity Framework Designer。我想问一下如何创建我的实体文件。我希望有10个表,并且所有这些表都将被链接到至少一个其他表。我应该只创建一个文件并将所有模型放在那里,或者为每个模型创建一个单独的文件。

I don't know if this is even a question but I could find my answer on Google. I didn't know how to define it actually... :D

我不知道这是否是一个问题,但我可以在Google上找到答案。我不知道如何定义它......:D

So if you have any tips on how I should model my database that will be awesome. Also if you have any more information on when I should use different Entity files that will be useful too.

所以如果你有关于我应该如何建模我的数据库的任何提示,这将是非常棒的。此外,如果您有任何关于何时应该使用不同实体文件的信息,这些文件也是有用的。

I have used MySQL designer in the past but in there as far as i can remember you just move the model into the designer and you can make relations. So I'm kinda keen into doing that (all models in one Entity File) but wanted to check with you first guys.

我过去曾使用过MySQL设计师,但据我所知,你只需将模型移动到设计师中即可建立关系。所以我有点喜欢这样做(所有模型都在一个实体文件中),但是想先和你们一起检查一下。

1 个解决方案

#1


0  

just try this plugin for VS http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d to generate your classes from existing db

只需为VS http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d尝试此插件,即可从现有数据库生成类

#1


0  

just try this plugin for VS http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d to generate your classes from existing db

只需为VS http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d尝试此插件,即可从现有数据库生成类