public TrackableContext(TraceWriter writer) { try { if (Utils.GetAppSetting("Environment") == "Local") { TrackableDbContext.LoadSqlServerTypes(Environment.CurrentDirectory); } else { TrackableDbContext.LoadSqlServerTypes(@"D:\home\site\wwwroot"); } this.DbContext = new TrackableDbContext(Utils.GetAppSetting("DatabaseConnection")); this.LocationRepository = RepositoryFactory.CreateLocationRepository(this.DbContext); this.TrackingPointRepository = RepositoryFactory.CreateTrackingPointRepository(this.DbContext); this.ConfigurationRepository = RepositoryFactory.CreateConfigurationRepository(this.DbContext); this.TripRepository = RepositoryFactory.CreateTripRepository(this.DbContext); this.AssetRepository = RepositoryFactory.CreateAssetRepository(this.DbContext); this.TripDetectorFactory = new TripDetectorFactory( this.ConfigurationRepository, this.TripRepository, this.TrackingPointRepository, this.LocationRepository, Utils.GetAppSetting("BingMapsKey")); this.LoggerFactory = new LoggerFactory(); this.LoggerFactory.AddProvider(new TraceWriterProvider(writer, null)); this.traceWriter = writer; } catch (Exception e) { writer.Error("Error initializing trackable context", e); throw; } }
public GeoFenceAssetResolver(TrackableDbContext db) { this.db = db; }
public static IAssetRepository CreateAssetRepository(TrackableDbContext context) { return(new AssetRepository(context, mapper)); }
public static ITrackingPointRepository CreateTrackingPointRepository(TrackableDbContext context) { return(new TrackingPointRepository(context, mapper)); }
public static ILocationRepository CreateLocationRepository(TrackableDbContext context) { return(new LocationRepository(context, mapper)); }
public static IConfigurationRepository CreateConfigurationRepository(TrackableDbContext context) { return(new ConfigurationRepository(context, mapper)); }
/// <summary> /// Constructs new instance of the RepositoryBase. /// </summary> /// <param name="db">The db context.</param> /// <param name="mapper">The model mapper.</param> public DbRepositoryBase(TrackableDbContext db, IMapper mapper) { this.ObjectMapper = mapper.ThrowIfNull(nameof(mapper)); this.Db = db.ThrowIfNull(nameof(db)); }
public TrackingDeviceAssetResolver(TrackableDbContext db) { this.db = db; }
public TokenTrackingDeviceResolver(TrackableDbContext db) { this.db = db; }
public TrackingPointRepository(TrackableDbContext db, IMapper mapper) : base(db, mapper) { }
public GeoFenceRepository(TrackableDbContext db, IMapper mapper) : base(db, mapper) { }
public TripLegRepository( TrackableDbContext db, IMapper mapper) : base(db, mapper) { }
public TokenUserResolver(TrackableDbContext db) { this.db = db; }
public UserRepository(TrackableDbContext db, IMapper mapper) : base(db, mapper) { }
public ConfigurationRepository(TrackableDbContext db, IMapper mapper) : base(db, mapper) { }
public InstrumentationRepository(TrackableDbContext db, IMapper mapper) : base(db, mapper) { }
public AssetPropertiesRepository( TrackableDbContext db, IMapper mapper) : base(db, mapper) { }