Пример #1
0
        private static bool IsUserAuthorized(string userIdentity, string connection, DateTime?offset)
        {
            // Check token expiry
            if (offset == null || offset < DateTime.Now)
            {
                return(false);
            }

            var optionsBuilder = new DbContextOptionsBuilder <ThermoDataContext>();

            optionsBuilder.UseSqlServer(connection);

            // Query the user to see if they are legi users

            var themorDataSource = new ThermoDataContext(optionsBuilder.Options);
            var userInDataStore  = themorDataSource.Users.Where(x => x.Username == userIdentity).FirstOrDefault();

            return(userInDataStore != null ? true : false);
        }
Пример #2
0
 public EmailAlertRecipientDataProcessor(ThermoDataContext context)
 {
     _thermoDataContext = context;
 }
Пример #3
0
 public SummaryEmailProviderDataProcessor(ThermoDataContext context)
 {
     _thermoDataContext = context;
 }
 public DataStoreMessageProcessor(ThermoDataContext thermoDataContext)
 {
     _thermoDataContext = thermoDataContext;
 }
Пример #5
0
 public PersonDataService(ThermoDataContext thermoDataContext)
 {
     _thermoDataContext = thermoDataContext;
 }
Пример #6
0
 public UsersController(IOptions <AppSettings> appSettings, ThermoDataContext thermoDataContext)
 {
     _appSettings       = appSettings.Value;
     _thermoDataContext = thermoDataContext;
     _personDataService = new PersonDataService(thermoDataContext);
 }
 public SMTPSettingDataService(ThermoDataContext thermoDataContext)
 {
     _thermoDataContext = thermoDataContext;
 }
 public MobileAPIController(IOptions <AppSettings> appSettings, ThermoDataContext thermoDataContext)
 {
     _appSettings = appSettings.Value;
     db           = thermoDataContext;
 }
 public SmtpSettingsController(IOptions <AppSettings> appSettings, ThermoDataContext thermoDataContext)
 {
     _appSettings       = appSettings.Value;
     _thermoDataContext = thermoDataContext;
     _smtpDataService   = new SMTPSettingDataService(thermoDataContext);
 }