Exemplo n.º 1
0
 public ManagerBase(
     ILogger <IManagerBase <TKey, TModel> > logger,
     IStoreBase <TKey, TModel> store,
     IHttpContextAccessor contextAccessor)
 {
     _context = contextAccessor?.HttpContext;
     _store   = store;
 }
Exemplo n.º 2
0
        private static Task <IReadOnlyList <T> > ParseAndLoad <T, TBuilder>(IStoreBase <T, TBuilder> store, string strIds)
            where T : IStorable
        {
            if (strIds is null || strIds == string.Empty)
            {
                return(Task.FromResult(new T[0] as IReadOnlyList <T>));
            }

            var ids = StringToIds(strIds);

            return(StoreToStorables(store, ids));
        }
Exemplo n.º 3
0
        private static Task <IReadOnlyList <T> > StoreToStorables <T, TBuilder>(IStoreBase <T, TBuilder> store, IEnumerable <Guid> ids)
            where T : IStorable
        {
            if (ids is null)
            {
                return(null);
            }

            var tasks = ids.Select(store.LoadAsync).ToArray();

            return(Task.WhenAll(tasks).ContinueWith(task => task.Result as IReadOnlyList <T>));
        }
        protected BaseSimpleDesignerViewModel(IStoreBase <T, TBuilder> store)
        {
            Store        = store;
            Builder      = store.CreateBuilder();
            BuildCommand = new Command(HandleBuild);

            var loaderNames = App
                              .Container.Resolve <IImageStore>()
                              .RegisteredLoaders
                              .Select(loader => loader.Name);

            AvailableImageLoaders = new ObservableCollection <string>(loaderNames);
        }
Exemplo n.º 5
0
 protected ServiceBase(IStoreBase <TEntity> store)
 {
     Store = store;
 }