Ejemplo n.º 1
0
        public async Task <CustomersStatisticResponse> GetAsync([FromQuery] CustomersListRequestModel request)
        {
            var startDate = request.FromDate.Date;
            var endDate   = request.ToDate.Date.AddDays(1).AddMilliseconds(-1);

            var statistic = await _customerStatisticService.GetAsync(startDate, endDate);

            return(_mapper.Map <CustomersStatisticResponse>(statistic));
        }
Ejemplo n.º 2
0
        public async Task <CustomerListResponse> ListCustomers(CustomersListRequestModel requestModel)
        {
            var url        = GetUrl("?");
            var properties = from p in requestModel.GetType().GetProperties()
                             where p.GetValue(requestModel, null) != null
                             select p.Name + "=" + HttpUtility.UrlEncode(p.GetValue(requestModel, null).ToString());
            string queryString = url + String.Join("&", properties.ToArray());
            var    getResult   = await BaseClient.GetEntities(queryString, this._secretKey);

            return(JsonConvert.DeserializeObject <CustomerListResponse>(getResult));
        }