开发者

Is it better to have aspnet_regsql tables in separate db if using an entity framework model?

开发者 https://www.devze.com 2023-03-23 03:56 出处:网络
I heard it is not a good idea to bring in the tables created by the aspnet_regsql.exe into your entity model.Can they just be removed from the model or is it a bett开发者_如何转开发er idea to have it

I heard it is not a good idea to bring in the tables created by the aspnet_regsql.exe into your entity model. Can they just be removed from the model or is it a bett开发者_如何转开发er idea to have it in a separate database?


The default is to create an "aspnetdb" database separate from your application database. You can name the database whatever you like, but having a separate Application Services database is the best practice. It isolates your user store and prevents any conflicts from occurring between it and any other database.

Furthermore, you want to use the classes included with the .Net Framework to interact with your Application Services database; it has its own data access layer separate from your EF classes. You don't want to use EF to work directly on the database, so it makes more sense to separate them.


The tables create with that tool are for the asp providers and used by them. If you use those tables in you model you run the risk of modifying data that the providers would not expect. If you remove them from your model you will remove this risk. You could potentially still modify the data via Execute() but personally I do not see a problem with them being in the same database.

0

精彩评论

暂无评论...
验证码 换一张
取 消