2012-04-03 12 views
9

Próbowałem MvcMiniProfiler jako zamiennik dla EFTracingProvider, ponieważ jest o wiele prostsze w konfiguracji.Czy MvcMiniProfiler może wyświetlać wartości parametrów SQL?

Pokaże sql dobrze, ale chciałbym również zobaczyć wartości parametrów.

insert [dbo].[PersonName]([Prefix], [GivenName], [MiddleName], [FamilyName], [Affix]) 
values (@0, @1, @2, @3, @4) 
select [Id] 
from [dbo].[PersonName] 
where @@ROWCOUNT > 0 and [Id] = scope_identity() 

Czy MvcMiniProfiler wyświetlania wartości parametrów sql?

Oto mój Global.asax. Używam EF 4.3.1 z kodem-pierwszym.

protected void Application_Start() 
{ 
    Bootstrapper.Initialize(); 

    AreaRegistration.RegisterAllAreas(); 

    RegisterGlobalFilters(GlobalFilters.Filters); 
    RegisterRoutes(RouteTable.Routes); 

    MiniProfilerEF.Initialize(); 
} 

protected void Application_BeginRequest() 
{ 
    if (Request.IsLocal) 
    { 
     MiniProfiler.Start(ProfileLevel.Verbose); 
    } 
} 

protected void Application_EndRequest() 
{ 
    MiniProfiler.Stop(); 
} 

Odpowiedz

16

Jeśli chcesz SQL Server Formatter, spróbuj dodać:

MiniProfiler.Settings.SqlFormatter = 
    new StackExchange.Profiling.SqlFormatters.SqlServerFormatter(); 

W Application_Start

Powiązane problemy