forked from yavordimitrov/SmartStoreNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEfStartUpTask.cs
More file actions
27 lines (25 loc) · 762 Bytes
/
Copy pathEfStartUpTask.cs
File metadata and controls
27 lines (25 loc) · 762 Bytes
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
using SmartStore.Core;
using SmartStore.Core.Data;
using SmartStore.Core.Infrastructure;
namespace SmartStore.Data
{
public class EfStartUpTask : IStartupTask
{
public void Execute()
{
var settings = EngineContext.Current.Resolve<DataSettings>();
if (settings != null && settings.IsValid())
{
var provider = EngineContext.Current.Resolve<IEfDataProvider>();
if (provider == null)
throw new SmartException("No EfDataProvider found");
provider.SetDatabaseInitializer();
}
}
public int Order
{
//ensure that this task is run first
get { return -1000; }
}
}
}