Beispiel #1
0
        public static IEnumerable <ISupplierProductStateDto> ToSupplierProductStateDtoCollection(IEnumerable <SupplierProductId> ids)
        {
            var states = new List <ISupplierProductStateDto>();

            foreach (var id in ids)
            {
                var dto = new SupplierProductStateDtoWrapper();
                dto.SupplierProductId = id;
                states.Add(dto);
            }
            return(states);
        }
Beispiel #2
0
 public ISupplierProductStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = SupplierProductsControllerUtils.ParseIdString(id);
         var state = _supplierProductApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new SupplierProductStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = SupplierProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }