Exemple #1
0
        public IEnumerable <NotificationChannel> GetAll()
        {
            if (!_fileSystem.Exists(_notificationChannelsFils))
            {
                return(new NotificationChannel[0]);
            }
            var json = _fileSystem.ReadAllText(_notificationChannelsFils);
            var notificationChannels = _serializer.FromJson <IEnumerable <NotificationChannel> >(json);

            return(notificationChannels);
        }
        public IEnumerable <Deployment> GetAll()
        {
            if (!_fileSystem.Exists(_deploymentsFile))
            {
                return(new Deployment[0]);
            }
            var json        = _fileSystem.ReadAllText(_deploymentsFile);
            var deployments = _serializer.FromJson <IEnumerable <Deployment> >(json);

            return(deployments);
        }
Exemple #3
0
 public IEnumerable <ImprovableForListing> GetAllForListing(ImprovableId improvableId)
 {
     if (_fileSystem.Exists(_improvablesFile))
     {
         var json = _fileSystem.ReadAllText(_improvablesFile);
         return(_serializer.FromJson <IEnumerable <ImprovableForListing> >(json));
     }
     else
     {
         return(new ImprovableForListing[0]);
     }
 }
 /// <summary>
 /// Initializes a new instance of <see cref="AllImprovables"/>
 /// </summary>
 public AllImprovables(ITenantAwareFileSystem fileSystem, ISerializer serializer)
 {
     _fileSystem = fileSystem;
     if (_fileSystem.Exists(_improvablesFile))
     {
         var json = _fileSystem.ReadAllText(_improvablesFile);
         Query = serializer.FromJson <IEnumerable <ImprovableForListing> >(json).AsQueryable();
     }
     else
     {
         Query = new ImprovableForListing[0].AsQueryable();
     }
 }