public TaxonsController(DeterminationContext detContext, InformationContext infContext, ObservationContext obsContext, MappingContext mapContext) { _detContext = detContext; _infContext = infContext; _obsContext = obsContext; _mapContext = mapContext; }
// 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(); } }
/*** ** 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; }
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; }
public ValuesController(DeterminationContext detContext, InformationContext infContext, ObservationContext obsContext, MappingContext mapContext, IConfiguration smtpConfiguration) { _detContext = detContext; _infContext = infContext; _obsContext = obsContext; _mapContext = mapContext; _smtpConfig = smtpConfiguration; }
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); }
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(); }
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"); } }
public ImagesController(ObservationContext obsContext, InformationContext infContext) { _obsContext = obsContext; _infContext = infContext; }
public SqlOrmAnalyzer(ObservationContext context) { _dbContext = context; }
private static User GetCurrentUser(ObservationContext db, string windowsLogon) { return(db.Users.FirstOrDefault(user => user.WindowsLogon == windowsLogon)); }
public ObservationsController(ObservationContext context) { _context = context; }
public SaveToSqlWithOrmProcessor(ObservationContext context) { _dbContext = context; }
public SqlOrmStorage(ObservationContext context) { _dbContext = context; _observations = new List <FlashObservationWrapper>(); FetchFromDatabaseTable(); }