コード例 #1
0
        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;
            }
        }
コード例 #2
0
 public GeoFenceAssetResolver(TrackableDbContext db)
 {
     this.db = db;
 }
コード例 #3
0
 public static IAssetRepository CreateAssetRepository(TrackableDbContext context)
 {
     return(new AssetRepository(context, mapper));
 }
コード例 #4
0
 public static ITrackingPointRepository CreateTrackingPointRepository(TrackableDbContext context)
 {
     return(new TrackingPointRepository(context, mapper));
 }
コード例 #5
0
 public static ILocationRepository CreateLocationRepository(TrackableDbContext context)
 {
     return(new LocationRepository(context, mapper));
 }
コード例 #6
0
 public static IConfigurationRepository CreateConfigurationRepository(TrackableDbContext context)
 {
     return(new ConfigurationRepository(context, mapper));
 }
コード例 #7
0
 /// <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));
 }
コード例 #8
0
 public TrackingDeviceAssetResolver(TrackableDbContext db)
 {
     this.db = db;
 }
コード例 #9
0
 public TokenTrackingDeviceResolver(TrackableDbContext db)
 {
     this.db = db;
 }
コード例 #10
0
 public TrackingPointRepository(TrackableDbContext db, IMapper mapper)
     : base(db, mapper)
 {
 }
コード例 #11
0
 public GeoFenceRepository(TrackableDbContext db, IMapper mapper)
     : base(db, mapper)
 {
 }
コード例 #12
0
 public TripLegRepository(
     TrackableDbContext db,
     IMapper mapper)
     : base(db, mapper)
 {
 }
コード例 #13
0
 public TokenUserResolver(TrackableDbContext db)
 {
     this.db = db;
 }
コード例 #14
0
 public UserRepository(TrackableDbContext db, IMapper mapper)
     : base(db, mapper)
 {
 }
コード例 #15
0
 public ConfigurationRepository(TrackableDbContext db, IMapper mapper)
     : base(db, mapper)
 {
 }
コード例 #16
0
 public InstrumentationRepository(TrackableDbContext db, IMapper mapper)
     : base(db, mapper)
 {
 }
コード例 #17
0
 public AssetPropertiesRepository(
     TrackableDbContext db,
     IMapper mapper)
     : base(db, mapper)
 {
 }