public async Task <Response <List <OutletDTO> > > GetOutles()
        {
            var outlets = await _outletService.GetAllOutlets();

            var outletDTO = _mapper.Map <List <OutletDTO> >(outlets);
            var response  = new Response <List <OutletDTO> >(outletDTO);

            return(response);
        }
        public async Task <IActionResult> Index()
        {
            var outletDtos = await outletService.GetAllOutlets();  //from business DTOS

            List <OutletVM> outletList = outletDtos
                                         .Select(o => new OutletVM()
            {
                Id = o.Id, Name = o.Name, StreetName = o.StreetName, Landmark = o.Landmark, OpeningDate = o.OpeningDate
            })
                                         .ToList();

            return(View(outletList));
        }
Exemplo n.º 3
0
        public IEnumerable <OutletDto> Get()
        {
            var allmodel = _outletservice.GetAllOutlets();

            return(_mapper.Map <IEnumerable <OutletDto> >(allmodel));
        }