Exemplo n.º 1
0
        public IActionResult GetAll()
        {
            var items    = _itemService.GetAll();
            var itemDtos = _mapper.Map <IList <ItemDto> >(items);

            return(Ok(itemDtos));
        }
        public ActionResult <List <ItemHeaderResponse> > Get()
        {
            var result = _itemsService
                         .GetAll()
                         .Select(x => x.ToHeaderApiModel())
                         .ToList();

            return(result);
        }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            var items = _service
                        .GetAll()
                        .Select(item => new ItemModel(item))
                        .ToList();

            return(View(items));
        }
Exemplo n.º 4
0
        public IActionResult Operations()
        {
            var currUserId = userManager.GetUserId(User);
            var items      = itemsService.GetAll();

            //var items = itemsService.GetItemsByUserId(currUserId);
            return(View("Operations", items?.Select(itm => new DisplayToDoItem()
            {
                Description = itm.Description,
                Title = itm.Title
            })));
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_item_list);

            // Create your application here
            var bottomNavigation = FindViewById <BottomNavigationView>(Resource.Id.main_navigation);

            bottomNavigation.SetOnNavigationItemSelectedListener(this);

            var allItems = _itemsService.GetAll();
        }
Exemplo n.º 6
0
 public List <ItemReadModel> GetAll()
 {
     return(_service.GetAll().Select(item => new ItemReadModel(item)).ToList());
 }
Exemplo n.º 7
0
 public async Task <List <NamedAPIResource> > GetAll(int limit, int offset)
 => await _memoryCache.GetOrCreateAsync(
     $"{_typeName}-GetAll-{limit}-{offset}",
     entry => _itemsService.GetAll(limit, offset));
Exemplo n.º 8
0
        private async void LoadItems()
        {
            var allItems = _itemService.GetAll();

            ItemListView.ItemsSource = await allItems;
        }
Exemplo n.º 9
0
 public string ShowAll()
 {
     return(string.Join("\r\n",
                        _service.GetAll().Select(item => item.Text.Value)));
 }
Exemplo n.º 10
0
        // Read all
        public HttpResponseMessage Get()
        {
            var allItems = _itemsService.GetAll().Select(ItemViewModel.MapFromEntity);

            return(Request.CreateResponse(HttpStatusCode.OK, allItems));
        }
Exemplo n.º 11
0
        /*public List<ToDoItem> GetItems()
         * {
         *  List<ToDoItem> items = new List<ToDoItem>();
         *  items.Add(new ToDoItem { ItemId = 10, UserId = "19", Title = "aaa", Description = "bbbb" });
         *  items.Add(new ToDoItem { ItemId = 11, UserId = "20", Title = "ccc", Description = "dddd" });
         *
         *  return items;
         * }*/

        /*public ToDoItem GetItems()
         * {
         *  return new ToDoItem { ItemId = 10, UserId = "19", Title = "aaa", Description = "bbbb" };
         * }*/

        /*public JsonResult GetItemsJson()
         * {
         *  return Json(new ToDoItem()
         *  {
         *      ItemId = 10,
         *      UserId = "19",
         *      Title = "aaa",
         *      Description = "bbbb"
         *
         *  });
         * }
         */
        public IEnumerable <ToDoItem> GetItems()
        {
            var items = itemsService.GetAll();

            return(items);
        }