Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建一个 EF Code First 应用程序,我希望通过报告进一步使用该数据库。由于公司政策,我需要通过网络帐户执行此操作。
所以问题是 - 如何授予 Windows 用户对由 EF Code First 创建的数据库的 [读取] 权限?
编写授予权限 sql 并在Seed方法中执行
Seed
protected override void Seed(MyContext context) { ..... context.Database.ExecuteSqlCommand("GRANT ...."); }