public IEnumerable <IMovementConfirmationLineMvoStateDto> GetAll(string sort = null, string fields = null, int firstResult = 0, int maxResults = int.MaxValue, string filter = null)
 {
     try {
         IEnumerable <IMovementConfirmationLineMvoState> states = null;
         if (!String.IsNullOrWhiteSpace(filter))
         {
             states = _movementConfirmationLineMvoApplicationService.Get(CriterionDto.ToSubclass(JObject.Parse(filter).ToObject <CriterionDto>(), new ApiControllerTypeConverter(), new PropertyTypeResolver()
                                                                                                 , n => (MovementConfirmationLineMvoMetadata.Instance.FilteringPropertyAliasDictionary.ContainsKey(n) ? MovementConfirmationLineMvoMetadata.Instance.FilteringPropertyAliasDictionary[n] : n))
                                                                         , MovementConfirmationLineMvosControllerUtils.GetQueryOrders(sort, QueryOrderSeparator), firstResult, maxResults);
         }
         else
         {
             states = _movementConfirmationLineMvoApplicationService.Get(MovementConfirmationLineMvosControllerUtils.GetQueryFilterDictionary(this.Request.GetQueryNameValuePairs())
                                                                         , MovementConfirmationLineMvosControllerUtils.GetQueryOrders(sort, QueryOrderSeparator), firstResult, maxResults);
         }
         var stateDtos = new List <IMovementConfirmationLineMvoStateDto>();
         foreach (var s in states)
         {
             var dto = s is MovementConfirmationLineMvoStateDtoWrapper ? (MovementConfirmationLineMvoStateDtoWrapper)s : new MovementConfirmationLineMvoStateDtoWrapper(s);
             if (String.IsNullOrWhiteSpace(fields))
             {
                 dto.AllFieldsReturned = true;
             }
             else
             {
                 dto.ReturnedFieldsString = fields;
             }
             stateDtos.Add(dto);
         }
         return(stateDtos);
     } catch (Exception ex) { var response = MovementConfirmationLineMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
 public long GetCount(string filter = null)
 {
     try
     {
         long count = 0;
         if (!String.IsNullOrWhiteSpace(filter))
         {
             count = _movementConfirmationLineMvoApplicationService.GetCount(CriterionDto.ToSubclass(JObject.Parse(filter).ToObject <CriterionDto>(), new ApiControllerTypeConverter(), new PropertyTypeResolver()
                                                                                                     , n => (MovementConfirmationLineMvoMetadata.Instance.FilteringPropertyAliasDictionary.ContainsKey(n) ? MovementConfirmationLineMvoMetadata.Instance.FilteringPropertyAliasDictionary[n] : n)));
         }
         else
         {
             count = _movementConfirmationLineMvoApplicationService.GetCount(MovementConfirmationLineMvosControllerUtils.GetQueryFilterDictionary(this.Request.GetQueryNameValuePairs()));
         }
         return(count);
     } catch (Exception ex) { var response = MovementConfirmationLineMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }