Esempio n. 1
0
        public async Task <ActionResult <PublicApi.v1.DTO.Shop> > GetShop(int id)
        {
            var shop = await _bll.Shops.GetShopByShopId(id);

            if (shop == null)
            {
                return(NotFound());
            }

            return(ShopMapper.MapFromBLL(shop));
        }
Esempio n. 2
0
        public async Task <ActionResult <PublicApi.v1.DTO.Shop> > GetSingle()
        {
            var user = await _bll.AppUsers.FindAsync(User.GetUserId());

            if (user.ShopId == null)
            {
                return(NotFound());
            }

            var shop = await _bll.Shops.GetShopByShopId(user.ShopId);

            if (shop == null)
            {
                return(NotFound());
            }

            return(ShopMapper.MapFromBLL(shop));
        }
Esempio n. 3
0
        public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.Shop> > > GetShops()
        {
            var shop = (await _bll.Shops.GetAllWithCountsAsync()).Select(e => ShopMapper.MapFromBLL(e)).ToList();

            return(shop);
        }