Пример #1
0
        public async Task <IEnumerable <ContractDTO> > GetAllAsync()
        {
            var result = await _contractDal.GetAllAsync();

            return(result.Select(x => new ContractDTO
            {
                Description = x.Description,
                Id = x.Id.ToString()
                ,
                Price = x.Price,
                Type = x.Type
            }).ToList());
        }
Пример #2
0
        public async Task <IEnumerable <RestaurantListDTO> > GetAdminRestaurantList()
        {
            var list = await _restaurantDal.GetAllAsync();

            var contract = await _contractDal.GetAllAsync();

            return(list.Select(x => new RestaurantListDTO
            {
                isPromo = x.isPromo,
                isActive = x.isActive,
                Adress = x.Info.Adress.AdressDetail,
                Latitude = x.Info.Adress.Latitude,
                Longitude = x.Info.Adress.Longitude,
                Email = x.Email,
                Id = x.Id.ToString(),
                Name = x.Name,
                UserName = x.UserName,
                ContractName = contract.FirstOrDefault(z => z.Id == x.ContractId) == null ? "" : contract.FirstOrDefault(z => z.Id == x.ContractId).Type
            }));
        }