| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using OHV.Common.Model;
- using SQLite.CodeFirst;
- using System;
- using System.Collections.Generic;
- using System.Data.Entity;
- namespace OHV.SqliteDAL
- {
- public class OHVDbInitializer : SqliteDropCreateDatabaseWhenModelChanges<OHVDbContext>
- {
- public OHVDbInitializer(DbModelBuilder modelBuilder) : base(modelBuilder, typeof(CustomHistory))
- {
- }
- protected override void Seed(OHVDbContext context)
- {
- //base.Seed( context );
- // Here you can seed your core data if you have any.
- context.Set<Config>().AddRange(new List<Config>()
- {
- new Config
- {
- ID = "OCSAddrIP",
- Name = "OCSAddrIP",
- Value = "127.0.0.1",
- Desc = "",
- EditTime = DateTime.Now
- },
- new Config
- {
- ID = "OCSAddrPortNo",
- Name = "OCSAddrPortNo",
- Value = "5000",
- Desc = "",
- EditTime = DateTime.Now
- },
- new Config
- {
- ID = "VehicleID",
- Name = "VehicleID",
- Value = "V0001",
- Desc = "",
- EditTime = DateTime.Now
- },
- });
- context.Set<Route>().AddRange(new List<Route>()
- {
- new Route
- {
- },
- });
- }
- }
- }
|