Beispiel #1
0
 public async Task <List <DeliveryAddress> > GetDeliveryAddressByUserGuid(Guid userGuid)
 {
     using (IDAL.IDeliveryAddressService deliveryAddress = new DeliveryAddressService())
     {
         return(await deliveryAddress.GetAllAsync().Where(m => m.UserGuid == userGuid).ToListAsync());
     }
 }
        public BaseRequestResponse <List <DeliveryAddress> > Get(Guid userGuid)
        {
            //TODO 调用业务层获取数据库数据
            //此处直接手动写一些数据返回了
            IDeliveryAddressService deliveryAddressService = new DeliveryAddressService();
            List <DeliveryAddress>  list = deliveryAddressService.GetAllAsync().Where(m => m.UserGuid == userGuid).ToList();
            BaseRequestResponse <List <DeliveryAddress> > response
                = new BaseRequestResponse <List <DeliveryAddress> >
                {
                Code    = ResultCode.NormalCode,
                Result  = list,
                Message = "获取成功"
                };

            return(response);
        }