Ejemplo n.º 1
0
        public async virtual Task <IHttpActionResult> GetDeliverys(string userName, string token, int skipCount, int maxResultCount, string sorting = null, int?tenantId = null)
        {
            base.AuthUser();
            using (CurrentUnitOfWork.SetTenantId(tenantId))
            {
                var homeOwerUser = await _homeOwerUserManager.GetHomeOwerUserByUserName(userName);

                if (homeOwerUser.HomeOwerId == 0)
                {
                    throw ErrorCodeTypeUtils.ThrowError(ErrorCodeType.HomeOwerNotExists);
                }
                var input = new GetDeliverysInput();
                input.HomeOwerId     = homeOwerUser.HomeOwerId;
                input.MaxResultCount = maxResultCount;
                input.SkipCount      = skipCount;
                if (!string.IsNullOrEmpty(sorting))
                {
                    input.Sorting = sorting;
                }

                return(Ok(await _deliveryService.GetAllDeliverys(input)));
            }
        }