Пример #1
0
        private async void QueryCommandExecute()
        {
            var watch        = System.Diagnostics.Stopwatch.StartNew();
            var sqliteResult = await _sqliteService.GetAll();

            watch.Stop();

            Log += $"SQLite: QUERY 1000 items in {watch.ElapsedMilliseconds} milliseconds\n";

            watch.Restart();
            var realmResult = _realmService.GetAll();

            watch.Stop();

            Log += $"Realm: QUERY 1000 items in {watch.ElapsedMilliseconds} milliseconds\n";
        }
Пример #2
0
        private async void RefreshAllItems()
        {
            var result = await _sqliteService.GetAll();

            Items = new ObservableCollection <RecipeItem>();
            foreach (var item in result)
            {
                Items.Add(item);
            }
        }
Пример #3
0
        public override async void OnAppearing(object navigationContext)
        {
            base.OnAppearing(navigationContext);

            var result = await _sqliteService.GetAll();

            Items = new ObservableCollection <TodoItem>();
            foreach (var item in result)
            {
                Items.Add(item);
            }
        }
Пример #4
0
        public async Task <List <TBusiness> > GetAllAsync()
        {
            try
            {
                var entityList = await _dataService.GetAll <TEntity>();

                if (entityList.Any())
                {
                    return((from entity in entityList let business = new TBusiness() select MappingHelper.ConvertToModel(entity, business)).ToList());
                }
            }
            catch (Exception ex)
            {
                LogOrThrow(ex);
            }
            return(new List <TBusiness>());
        }