示例#1
0
        public async Task <UserListingVM> Get(Params param)
        {
            var vm = new UserListingVM(param ?? throw new ArgumentNullException());
            var q  = _query.CreateBaseQuery(Role.ToString());

            (var items, int total) = await _query.ApplyParameters(q, param);

            vm.SetItems(items, param.ItemPerPage, total);
            return(vm);
        }
        public async Task <PosListingVM> Get(Params param)
        {
            var vm = new PosListingVM(param ?? throw new ArgumentNullException());
            var q  = _query.CreateBaseQuery(Role.ToString());

            (var items, int total) = await _query.ApplyParameters(q, param);

            vm.SetItems(items, param.ItemPerPage, total);
            //Availabe shifts
            vm.Shifts = await DbContext.Shift
                        .OrderBy(s => s.DisplayOrder)
                        .Select(s => new ShiftDTO(s)).ToListAsync();

            return(vm);
        }