Exemplo n.º 1
0
 public TaxonsController(DeterminationContext detContext, InformationContext infContext, ObservationContext obsContext, MappingContext mapContext)
 {
     _detContext = detContext;
     _infContext = infContext;
     _obsContext = obsContext;
     _mapContext = mapContext;
 }
Exemplo n.º 2
0
 // ugly method to touch the db so that the first db connection happens at startup and not the first time a user tries to log an observation
 private static void TouchDb()
 {
     using (var db = new ObservationContext())
     {
         var user = db.Users.FirstOrDefault();
     }
 }
Exemplo n.º 3
0
 /***
 ** Advice = Event + Observation
 ** Event = Fundort
 ** Observation = Fund
 ** Observation = ObservationInfo + optional List of Images
 ***/
 public AdviceController(UserManager <ApplicationUser> userManager, DeterminationContext detContext, InformationContext infContext, ObservationContext obsContext, MappingContext mapContext, LocationContext locContext, PublicContext idoContext)
 {
     _userManager = userManager;
     _obsContext  = obsContext;
     _locContext  = locContext;
     _idoContext  = idoContext;
 }
Exemplo n.º 4
0
 public DescriptionKeyGroupsController(DeterminationContext detContext, InformationContext infContext, ObservationContext obsContext, MappingContext mapContext)
 {
     _detContext = detContext;
     _infContext = infContext;
     _obsContext = obsContext;
     _mapContext = mapContext;
 }
 public ApplicationUserController(UserManager <ApplicationUser> userManager, IOptions <ApplicationSettings> appSettings, PublicContext idoContext, ObservationContext obsContext, IConfiguration smtpConfiguration)
 {
     _smtpConfig  = smtpConfiguration;
     _userManager = userManager;
     _appSettings = appSettings.Value;
     _idoContext  = idoContext;
     _obsContext  = obsContext;
 }
Exemplo n.º 6
0
 public ValuesController(DeterminationContext detContext, InformationContext infContext, ObservationContext obsContext, MappingContext mapContext, IConfiguration smtpConfiguration)
 {
     _detContext = detContext;
     _infContext = infContext;
     _obsContext = obsContext;
     _mapContext = mapContext;
     _smtpConfig = smtpConfiguration;
 }
Exemplo n.º 7
0
        private static void CreateCurrentUser(string windowsLogon, ObservationContext db)
        {
            var newUser = new User {
                UserName = windowsLogon, WindowsLogon = windowsLogon
            };

            db.Users.Add(newUser);
        }
        public void GivenIHaveAnObservationContext()
        {
            this.testState = MockRepository.GenerateMock<ITestState<DummyClassWithSingleParameterisedConstructor>>();
            this.subjectDependencyBuilder = MockRepository.GenerateMock<ISubjectDependencyBuilder>();
            this.mockFactory = MockRepository.GenerateMock<IMockFactory>();
            this.subjectFactory = MockRepository.GenerateMock<ISubjectFactory>();

            this.subject = new ObservationContext<DummyClassWithSingleParameterisedConstructor>(
                this.testState, this.subjectDependencyBuilder, this.mockFactory, this.subjectFactory);
        }
        private void InitContexts()
        {
            var optionsBuilderInf = new DbContextOptionsBuilder <InformationContext>();

            optionsBuilderInf.UseNpgsql(Program.Configuration.GetConnectionString("DatabaseConnection"));
            _contextInf = new InformationContext(optionsBuilderInf.Options);

            var optionsBuilderObs = new DbContextOptionsBuilder <ObservationContext>();

            optionsBuilderObs.UseNpgsql(Program.Configuration.GetConnectionString("DatabaseConnection"));
            _contextObs = new ObservationContext(optionsBuilderObs.Options);
        }
Exemplo n.º 10
0
 static void Main(string[] args)
 {
     System.Console.WriteLine("Started");
     using (var db = new ObservationContext())
     {
         var windowsLogon = WindowsIdentity.GetCurrent().Name;
         var observations = db.Observations;
         foreach (var observation in observations)
         {
             System.Console.WriteLine("{0}: {1} {2}", windowsLogon, observation.ObservationText, observation.ObservationDate.ToString("yyyy-MM-dd hh:mm:ss"));
         }
     }
     System.Console.WriteLine("Done. Press any key");
     System.Console.ReadKey();
 }
Exemplo n.º 11
0
        private void Init()
        {
            try
            {
                Logger.Info("Initializing AppData ..");
                var optionsBuilderDet = new DbContextOptionsBuilder <DeterminationContext>();
                optionsBuilderDet.UseNpgsql(Program.Configuration.GetConnectionString("DatabaseConnection"));
                _detContext = new DeterminationContext(optionsBuilderDet.Options);

                var optionsBuilderInf = new DbContextOptionsBuilder <InformationContext>();
                optionsBuilderInf.UseNpgsql(Program.Configuration.GetConnectionString("DatabaseConnection"));
                _infContext = new InformationContext(optionsBuilderInf.Options);

                var optionsBuilderObs = new DbContextOptionsBuilder <ObservationContext>();
                optionsBuilderObs.UseNpgsql(Program.Configuration.GetConnectionString("DatabaseConnection"));
                _obsContext = new ObservationContext(optionsBuilderObs.Options);

                Logger.Info(".. Success");
            }
            catch (Exception e)
            {
                Logger.Error(e, "Init Import Meta failed");
            }
        }
Exemplo n.º 12
0
 public ImagesController(ObservationContext obsContext, InformationContext infContext)
 {
     _obsContext = obsContext;
     _infContext = infContext;
 }
Exemplo n.º 13
0
 public SqlOrmAnalyzer(ObservationContext context)
 {
     _dbContext = context;
 }
Exemplo n.º 14
0
 private static User GetCurrentUser(ObservationContext db, string windowsLogon)
 {
     return(db.Users.FirstOrDefault(user => user.WindowsLogon == windowsLogon));
 }
 public ObservationsController(ObservationContext context)
 {
     _context = context;
 }
Exemplo n.º 16
0
 public SaveToSqlWithOrmProcessor(ObservationContext context)
 {
     _dbContext = context;
 }
Exemplo n.º 17
0
 public SqlOrmStorage(ObservationContext context)
 {
     _dbContext    = context;
     _observations = new List <FlashObservationWrapper>();
     FetchFromDatabaseTable();
 }