使用EF Code First限制单个应用程序的数据库.. [英] Restrict db with single application using EF Code First..

查看:110
本文介绍了使用EF Code First限制单个应用程序的数据库..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MVC处理EF代码。我想仅为一个应用程序限制数据库,以保护数据库结构修改与其他应用程序。有没有办法用单个应用程序限制db?

I m working on EF code fist using MVC. I would like to restrict the database for one application only in order to protect the database structure modification from the other application. Is there any way to restrict db with single application?

推荐答案

如果你问的是如何将对数据库的访问限制为只有一个应用程序的一个实例机器我无法做到这一点。
If you're asking how to restrict access to your database to only one instance of an application from a single machine there's no way I know of to do that.


您可以将数据库切换到单用户模式;在这个数据库上,任何时候都只能有一个连接。

但这是非常严格的限制。您确定必须使用您的应用程序触摸数据库的结构吗? EF应用程序通常处理数据而不是数据库结构。
You can switch your database to single user mode; only one connection will then be possible at any time on this database.
But this is quite restrictive. Are you sure you will have to touch the structure of the database with your application? EF applications usually handle data rather than database structure.


这篇关于使用EF Code First限制单个应用程序的数据库..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆