forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfiledDbProviderFactory.cs
More file actions
42 lines (36 loc) · 1.08 KB
/
ProfiledDbProviderFactory.cs
File metadata and controls
42 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#if !NETSTANDARD2_0
using System.Data.Common;
namespace ServiceStack.MiniProfiler.Data
{
/// <summary>
/// Wrapper for a db provider factory to enable profiling
/// </summary>
public class ProfiledDbProviderFactory : ProfiledProviderFactory
{
/// <summary>
/// Every provider factory must have an Instance public field
/// </summary>
public new static ProfiledDbProviderFactory Instance = new ProfiledDbProviderFactory();
/// <summary>
/// Used for db provider apis internally
/// </summary>
private ProfiledDbProviderFactory ()
{
}
/// <summary>
/// proxy
/// </summary>
public override DbCommand CreateCommand()
{
return new ProfiledDbCommand(WrappedFactory.CreateCommand(), null, Profiler);
}
/// <summary>
/// proxy
/// </summary>
public override DbConnection CreateConnection()
{
return new ProfiledDbConnection(WrappedFactory.CreateConnection(), Profiler);
}
}
}
#endif