public NutrientIntakeRepository(StorageTypeSetting.StorageTypes storageType)
        {
            switch (storageType)
            {
            case StorageTypeSetting.StorageTypes.SQL:
                _context = new ArticleContextSQL();
                break;

            case StorageTypeSetting.StorageTypes.Memory:
                _context = new ArticleContextMemory();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(storageType), storageType, "Set Storage Type");
            }
        }
Beispiel #2
0
        public GoalLogRepository(StorageTypeSetting.StorageTypes storageType)
        {
            switch (storageType)
            {
            case StorageTypeSetting.StorageTypes.SQL:
                _context = new GoalLogsContextSql();
                break;

            case StorageTypeSetting.StorageTypes.Memory:
                _context = new GoalLogContextMemory();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(storageType), storageType, "Set Storage Type");
            }
        }
Beispiel #3
0
        public UserRepository(StorageTypeSetting.StorageTypes storageType)
        {
            _storageType = storageType;
            switch (storageType)
            {
            case StorageTypeSetting.StorageTypes.SQL:
                _context = new UserContextSQL();
                break;

            case StorageTypeSetting.StorageTypes.Memory:
                _context = new UserContextMemory();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(storageType), storageType, "Set Storage Type");
            }
        }