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); }
public IActionResult Index() { var items = _service .GetAll() .Select(item => new ItemModel(item)) .ToList(); return(View(items)); }
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 }))); }
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(); }
public List <ItemReadModel> GetAll() { return(_service.GetAll().Select(item => new ItemReadModel(item)).ToList()); }
public async Task <List <NamedAPIResource> > GetAll(int limit, int offset) => await _memoryCache.GetOrCreateAsync( $"{_typeName}-GetAll-{limit}-{offset}", entry => _itemsService.GetAll(limit, offset));
private async void LoadItems() { var allItems = _itemService.GetAll(); ItemListView.ItemsSource = await allItems; }
public string ShowAll() { return(string.Join("\r\n", _service.GetAll().Select(item => item.Text.Value))); }
// Read all public HttpResponseMessage Get() { var allItems = _itemsService.GetAll().Select(ItemViewModel.MapFromEntity); return(Request.CreateResponse(HttpStatusCode.OK, allItems)); }
/*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); }