コード例 #1
0
        public static IEnumerable <IOrderStateDto> ToOrderStateDtoCollection(IEnumerable <string> ids)
        {
            var states = new List <IOrderStateDto>();

            foreach (var id in ids)
            {
                var dto = new OrderStateDtoWrapper();
                dto.OrderId = id;
                states.Add(dto);
            }
            return(states);
        }
コード例 #2
0
 public IOrderStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = id;
         var state = _orderApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new OrderStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = OrdersControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }