【问题标题】:MiniProfiler with EF5 CodeFirst SimpleMembership and Specify database nameMiniProfiler 与 EF5 CodeFirst SimpleMembership 并指定数据库名称
【发布时间】:2013-04-12 18:26:39
【问题描述】:

我有一个带有迁移的 EF 5 CodeFirst (DBContext) 的 MVC 4 Web 应用程序。我正在使用通过 EF 5 绑定的 SimpleMembership。我的数据库是 SQL Server 2012,我没有创建和删除数据库的权限,因此我指定了数据库名称。

我查看了多个站点来设置 MiniProfiler,但我无法将 2 和 2 放在一起。以下是我的问题:

1) 我可以将 MiniProfiler 与 EF 5 (DBContext)、SimpleMembership 一起使用并指定数据库名称吗? 2)如果可能的话,您能否为我提供一个演练。请具体一点,因为我是新手。我的 DBContext 是这样设置的:

public class DataContext : DbContext
{
    public DataContext() : base("DatabaseNameHere")
    { }

    public DbSet<Table1> Table1 { get; set; }
    public DbSet<Table2> Table2 { get; set; }    
}

【问题讨论】:

  • SO 通常不提供演练,不太具体。您需要尝试一些东西,给我们一些代码 - 以及您遇到的一些具体问题。我只能说它有效,应该有效。

标签: entity-framework ef-code-first dbcontext mvc-mini-profiler simplemembership


【解决方案1】:

好的,经过大量挖掘,我找到了解决方案。正如上面的评论所述,这确实有效。这是帮助您完成演练的链接。

http://www.codeproject.com/Articles/516627/MiniProfilerplus-plusInstallationplusandplusSetup

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-06
    • 1970-01-01
    相关资源
    最近更新 更多